AT&T 6300 Programmer's Manual page 367

Gwbasic by microsoft
Hide thumbs Also See for 6300:
Table of Contents

Advertisement

Syntax 1
Syntax 2
numexp
linenum
Remarks
Example
ON...GOSUB and ON...GOTO
Statements
ON...GOSUB calls one of several specified
subroutines, depending on the value of a
specified expression. ON...GOTO branches like
GOSUB but does not return from the branch.
ON numexp GOSUB linenum [ ,linenum]...
ON numexp GOTO linenum [ , linenum]...
is a numeric expression (from 0 to 255) which determines which
line number in the list to use for branching. If 'numexp' is
not an integer, it is rounded up to an integer.
is the line number to which the branch is made
In the ON...GOSUB statement, each line
number in the list must be the first line
number of a subroutine. If the value of
"numexp" is 1 the subroutine at the first line
number in the list will be called; a value of 2
causes the subroutine at the second line
number in the list to be called; and so on. If the
value of "numexp" is zero or greater than the
number of items in the list (but less than or
equal to 255), GWBASIC continues with the
next executable statement. If the value of
"numexp" is negative or greater than 255, an
"Illegal function call" error occurs.
100 ON L-l GOTO 150,300,320,390
7-211

Advertisement

Table of Contents
loading

Table of Contents