Command ACCEPT Foundation

Assigns keyboard input to a memory variable.

ACCEPT [<SayExpression>] TO <VarName>
<SayExpression> can be specified as an expression with a value of data type character, numeric, date or logical. The value of this expression is displayed on screen in front of the input area.
<VarName> specifies the variable to which the input characters are assigned. If the variable is not declared, a PRIVATE variable with this name is generated.

The command ACCEPT allows input of characters using the keyboard and assigns these input characters as a character string to a variable. It is a very simple input routine. Prior to the input, the control characters carriage-return line-feed (Chr(13)+Chr(10)) are output, so that the cursor appears at the beginning of the next screen line. <SayExpression> is then displayed and the command waits for keyboard input from the user.

The input characters are assigned to the variable <VarName> as a character string as soon as the return key is pressed by the user. This is the only key which terminates the input. The Esc key is not supported. Only the backspace and the left arrow/right arrow keys are supported as editing keys.

The command ACCEPT exists only for compatibility reasons. User input should be performed using @...SAY or @...GET instead of ACCEPT.

// The example shows the various ways the command 
// ACCEPT can be used. 

   LOCAL cVar 

   ACCEPT "Input:"   TO cVar 

   ACCEPT 12345      TO cVar 

   ACCEPT Date()     TO cVar 

   ACCEPT .T.        TO cVar 

   ACCEPT TO cVar 



If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.