The INPUTNULL statement defines a character to be interpreted as the null string if sent as a response to an INPUT @ statement.
Format
INPUTNULL expr |
Parameter(s)
expr |
An expression evaluating to a single character. Any extraneous characters in the expression is ignored. |
Description
The INPUTNULL statement establishes a character to be interpreted as the null string in response to an INPUT@ statement, thus allowing the programmer to specify a character to be used as an exit from a masked INPUT@ statement.
Normally the INPUT@ statement continues to prompt the user until a response matching the mask is entered. The only exceptions to this are the characters specified by the INPUTTRAP statement, and the null string. The INPUTNULL statement allows the programmer to specify a character to be interpreted as the null string, thus providing an exit from INPUT @.
Example
In the next application the user is prompted for a price, and the INPUTNULL statement is used to allow the user to specify 0 by entering an X.
INPUTNULL " X " PRINT @(-1) : "ENTER A DOLLAR AMOUNT" INPUTERR 'ENTER "X" FOR A ZERO AMOUNT' INPUT @ (23,0) VALUE "L2,$" |
See Also