InpStr
!! CAUTION !! | Obsolete Syntax! Available until Version 2013.r3 Replaced by .InpStr() of the interfaces Uart and SoftUart. |
---|
Read character string from serial port, including optional input prompt and echo.
Syntax: InpStr [Prompt, ] TargetString
- Prompt (optional): Character string (Constant) That is displayed prior to an input request.
- TargetString: String-Variable (memory) that stores the result string.
If you omit the port number, Uart0 will be assumed. The function waits until CR (Ascii-13) is received. Null bytes and control characters, except Backspace are ignored. Backspace will be removed from the resulting string.
Properties of InpStr (Global) | |
---|---|
Name | Description |
InpStr.echo.enable | Aktivates the input echo (Default). |
InpStr.echo.Disable | Deactivates the input echo. |
The property takes global effect and must be defined at program start (Switch).
See also: Idle-endIdle
Example 1:
dim inputstring as string do InpStr " Please enter text > ",inputstring Print " You have entered: ";34;inputstring;34 loop
Terminal program display:
Please enter text > hello You have entered: "hello" Please enter text > |
Example 2:
dim inputstring as string do InpStr inputstring Print "You have entered: ";34;inputstring;34 loop