_accept Function (String)
Take input from the keyboard and assign it to a memory variable.
XSharp.RT (in XSharp.RT.dll) Version: 2.4a
Syntax View Source
uValuePrompt AS STRING
) AS STRING
public static string _accept(
- Type: String
An optional prompt displayed before the input area.
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 <cVar>.
This example uses ACCEPT to get keyboard input from the user:
1LOCAL cVar AS STRING
2cVar := _Accept("Enter a value: " )
3IF cVar = NULL_STRING
4? "User pressed Enter"
6? "User input:", cVar