|Note||This command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available|
Take input from the keyboard and assign it to a memory variable.
ACCEPT [<uValuePrompt>] TO <idVar>
|<uValuePrompt>||An optional prompt displayed before the input area.|
|TO <idVar>||The variable that will hold input from the keyboard. If there is no variable named <idVar> that is visible to the current routine, a private variable is created.|
When ACCEPT is executed, it first performs a carriage return/linefeed, displays the prompt in the terminal window, and begins taking characters from the keyboard at the position immediately following the prompt.
Up to 255 characters can be entered. When input reaches the edge of the window, as defined by MaxCol(), the cursor moves to the next line.
ACCEPT supports only two editing keys: Backspace and Enter (Esc is not supported). Backspace deletes the last character typed. Enter confirms entry and is the only key that can terminate an ACCEPT. If Enter is the only key pressed, ACCEPT assigns a NULL_STRING to <idVar>.
This example uses ACCEPT to get keyboard input from the user:
ACCEPT "Enter a value: " TO cVar
IF cVar = NULL_STRING
? "User pressed Enter"
? "User input:", cVar