Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!pyramid!pesnta!hplabs!qantel!lll-lcc!lll-crg!seismo!brl-adm!brl-smoke!smoke!cottrell@NBS-VMS.ARPA From: cottrell@NBS-VMS.ARPA (COTTRELL, JAMES) Newsgroups: net.lang.c Subject: Gosub Message-ID: <1511@brl-smoke.ARPA> Date: Tue, 4-Mar-86 16:33:11 EST Article-I.D.: brl-smok.1511 Posted: Tue Mar 4 16:33:11 1986 Date-Received: Sat, 8-Mar-86 22:23:00 EST Sender: news@brl-smoke.ARPA Lines: 24 /* > In basic there is a GOSUB routine that will push the current > position onto the stack and jump to another line. Then, upon > hitting a return will return to that place. I wish to write > something like that in C that will be movable between compilers. > > A sample of something like it is below: > > [Example Deleted] > > Can anybody think of a better way to do this? I want it for a > Basic->C translator (Please, I am writting it for fun... No abuse...Please?). To answer a somewhat different question, while I am opposed to this construct in C (because it messes with the stack, making things difficult), I would very much like to see this in shell command files. Here, there is no stack, and variables would be global to the command file. I feel that the overhead of opening another file and the difficulty of passing back results (`cmd args` is limited) justifies it. What say ye? jim cottrell@nbs */ ------