basic.inputtrap.goto Statement/BASIC Program

basic.inputtrap.goto

Command basic.inputtrap.goto Statement/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description using the string.expression, it sets up an automatic "computed goto" based on the next input @ statement's data. The position of each character in the string.expression corresponds to the position of the statement.label in the list. This acts as a "trap" which causes a "goto" on all subsequent "input @" statements and branches to a label in the current program.

"inputtrap" must precede its associated "input @" statement. Only one inputtrap statement can be active at any time.

If data is entered that does not correspond to the inputtrap string.expression then no "trap" occurs and execution continues with the statement after the "input @".
Syntax inputtrap string.expression goto statement.label{ ,statement.label{,...}}
Options
Example
inputtrap "abcd" goto 10,20,30,40
input @(5,5):x
stop
10 print "You entered a"
stop
20 print "You entered b"
stop
30 print "You entered c"
stop
40 print "You entered d"
stop
Purpose
Related basic.inputnull
basic.inputerr
basic.inputtrap.gosub
basic.statements
basic.string.expression