basic.on.goto
Calculated goto.
Syntax
on index.expression goto statement.label{, statement.label...} on index.expression goto statement.label,..., statement.label, statement.label
Description
transfers control to the line within the Pick/BASIC program which begins with the specified statement label, according to the positional value of the index expression referenced by 'index.expression'. The syntax also allows being specified as 'on ... go to ...' (it allows a space between 'go' and 'to').
The 'on ... goto' is identical to the 'on ... gosub', except there is no 'return' required.
Example
on response goto 100,200,300,400,500
This is an indexed branch in the single-line format.
on response goto 100,200,300,
400,500,600,
700,800,900
This is an indexed branch in multi-line format.
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
