Produces a dialog that reads a string of characters.
Scope: Global
Syntax
Parameters
Length |
Maximum number of characters to be input, including the initial text. The length can be wider than the physical screen. |
TextString |
Initial text to appear inside the text entry box. |
Description
The lineread command requests a line of input from the user. A dialog is displayed with a text entry box and three pushbuttons: OK, Cancel, and Help. The text entry box can display an optional TextString as a suggested input value which a user can accept or replace as required.
The button used to leave the dialog can be retrieved using the lastkey parameter. The text typed in the box, including the initial text, can be retrieved using the lastline parameter. If Cancel is used to leave the dialog, the lastline contains the initial text.
| Note: | Although a macro can request a line of input, it cannot process the response. This command may be more useful in an external program where processing can take place. |
Example
To obtain a filename from a user using a dialog, type:
lineread 40 Enter the filename:
A dialog is displayed with a text entry box for user response that contains an initial value of Enter the filename:.
API Return Code
-1 |
Length must be a positive integer. |
![]()
lastkey Parameter
lastline Parameter
