INPUTTRAP ... GOTO

INPUTTRAP ... GOTO


INPUTTRAP ... GOSUB Index Level INS
Syntax INPUTTRAP string.expression GOTO statement.label{ ,statement.label{,...}}
INPUTTRAP OFF
Category BASIC
Type Statement
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 @".

"inputtrap off" cancels any previous "inputtrap" statement.
Options
See Also INPUTNULL INPUTERR INPUTTRAP ... GOSUB statements & functions string.expression
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
Warnings
Compatibility D3 7.0 AP R83
INPUTTRAP ... GOSUB Index Level INS