INPUTTRAP ... GOSUB

INPUTTRAP ... GOSUB


INPUTPARITY Index Level INPUTTRAP ... GOTO
Syntax INPUTTRAP string.expression GOSUB statement.label{ ,statement.label...}
INPUTTRAP OFF
Category BASIC
Type Statement
Description using the string.expression, it sets up an automatic "computed gosub" based on the next "input @" statements data. The position of the character in the string.expression corresponds to the position of the statement.label in the list. This acts as a "trap" which causes a "gosub" on all subsequent "input @" statements.

Upon "return" from a "gosub" specification, execution continues at the statement following the  "inputtrap" command, not the "input @" statement.

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

"inputtrap off" cancels any previous "inputtrap" statement.  
Options
See Also INPUTERR INPUTNULL string.expression INPUTTRAP ... GOTO statements & functions INPUT
Example inputtrap "abcd" gosub 10,20,30,40
input @(5,5):x
stop
10 print "You entered a"
return
20 print "You entered b"
return
30 print "You entered c"
return
40 print "You entered d"
return
Warnings
Compatibility D3 7.0 AP R83
INPUTPARITY Index Level INPUTTRAP ... GOTO