•  Back 
  •  Main 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The GFA-Basic Compendium
Author      : GFA Systemtechnik GmbH
Version     : GFABasic.HYP v2.98 (12/31/2023)
Subject     : Documentation/Programming
Nodes       : 899
Index Size  : 28056
HCP-Version : 3
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Document not found
@help       : Help
@options    : +g -i -s +z
@width      : 75
@hostname   : STRNGSRV
@hostname   : CAB     
@hostname   : HIGHWIRE
@hostname   : THING   
View Ref-FileON x GOSUB proc1,proc2, ...

x: iexp
proc1, proc2: procedure name witb out parameter

This command branches the program to a procedure, which is in the list
specified after GOSUB. The x is a numerical (normally integer) expression,
whose decimal part (if any) is ignored. If x is smaller than 1 or larger than
the number of the procedure names after the GOSUB, then no subroutine is
called. After calling the subroutine the program execution is continued
immediately after the ON x GOSUB. With this command no parameters can be passed
to the procedure.

Example:

    x=3
    ON x GOSUB proc1,proc2,proc3
    x=1
    ON x+1 GOSUB proc1,proc2,proc3,proc4

--> First the procedure proc3 is called, then the procedure proc2.

Memo: If the procedure used with ON GOSUB is undefined the compiler will
      not issue an error message. Instead the compiler writes a bad binary
      where ON GOSUB is translated into JSR 0.l!