Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!dimacs.rutgers.edu!seismo!hal!stevem From: stevem@hal.CSS.GOV (Steve Masters) Newsgroups: comp.sys.amiga.programmer Subject: Re: AREXX Question. How To Goto. Message-ID: <506@hal.CSS.GOV> Date: 20 Jan 91 21:09:38 GMT References: <16433@venera.isi.edu> <1991Jan20.200834.25560@bronze.ucs.indiana.edu> Distribution: na Organization: ENSCO Inc., Melbourne FL Lines: 40 graham@venus.iucf.indiana.edu (JIM GRAHAM) writes: >In article <16433@venera.isi.edu>, schur@isi.edu (Sean Schur) writes... >>I would like to know what works as a "goto" statement in AREXX. >>I noticed that you can "label" any point in the program with the >>command - >> >>label: >> >>But once you've labeled that point, how do you tell the program to >>go to that point? Is this the way to do a "goto" or am I way off base? >>If I am, I would appreciate it if someone could steer me in the >>right direction. >use the call statement. The 'call' statement is for subroutine (FORTRAN analogy) calls...enter and return to the statement after the call. The AREXX statement for 'goto' is 'signal'. /* */ say '1' signal thelabel say '2' thelabel: say '3' exit The program above will print 1 then 3 (skipping the "say '2'" statement. The manual discourages the use of 'signal' as a 'goto' because it is not 'structured programming.' (sigh :) ...before we start a style war...I agree it should rarely be needed, but I have seen some real programs (tm) that could have been greatly simplified in design and readability with a simple goto, signal, etc.) Steve Masters stevem@hal.CSS.GOV ENSCO, Inc. Melbourne, FL 32940 (407) 254 4122