Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site houligan.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!pesnta!peora!ucf-cs!novavax!houligan!daemon From: daemon@houligan.UUCP Newsgroups: net.lang.c Subject: Re: Re: Gosub Message-ID: <355@houligan.UUCP> Date: Mon, 31-Mar-86 16:08:58 EST Article-I.D.: houligan.355 Posted: Mon Mar 31 16:08:58 1986 Date-Received: Sat, 5-Apr-86 03:24:14 EST Sender: daemon@houligan.UUCP Organization: Gould Electronics, Ft. Lauderdale, Florida. Lines: 27 > > /* > > > 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. > > > > > > [[Example Deleted] Deleted] > > > > 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 > > */ > Sorry jim, we're ahead of you. It's called "function", and it's in > both the System V shell and the Korn shell. You probably missed it > because you were looking for it under "funx" in the manual pages. > -- > > Griff Smith AT&T (Bell Laboratories), Murray Hill > Phone: (201) 582-7736 > Internet: ggs@ulysses.uucp > UUCP: ulysses!ggs ( {allegra|ihnp4}!ulysses!ggs )