Place keyboard input into a memory variable
ACCEPT [<expPrompt>] TO <idVar>
<expPrompt> is an optional prompt displayed before the input area. The prompt can be an expression of any data type.
<idVar> is the variable that will hold input from the keyboard. If the specified <idVar> does not exist or is not visible, a private variable is created.
ACCEPT is a console command and wait state that takes input from the keyboard and assigns it as a character string to the specified variable. When ACCEPT is executed, it first performs a carriage return/linefeed, displays the prompt, and then begins taking characters from the keyboard at the first character position following the prompt. You may input up to 255 characters. When input reaches the edge of the screen, as defined by MAXCOL(), the cursor moves to the next line.
ACCEPT supports only two editing keys: Backspace and Return. Esc is not supported. Backspace deletes the last character typed. Return confirms entry and is the only key that can terminate an ACCEPT. If Return is the only key pressed, ACCEPT assigns a null value (“”) to <idVar>.
. This example uses ACCEPT to get keyboard input from the user: LOCAL cVar ACCEPT "Enter a value: " TO cVar IF cVar == "" ? "User pressed Return" ELSE ? "User input:", cVar ENDIF
@…GET, @…SAY, INKEY(), INPUT*, KEYBOARD, WAIT*