basic.on.goto

Statement/BASIC Program, Releases: AP and R83

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

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.go.to Statement Transfers execution to statement label.
basic.statement.labels Definition used as the destination of a 'goto' or 'gosub' statement.
basic.on.gosub Statement Calculated gosub.
ue.01bc User Exit 'n'-way branch.
ue.01a2 User Exit 'n'-way branch.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.