[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Use InputQuery to show a dialog box to get some input from the user
Source position: line 0
function InputQuery( |
const ACaption: String; |
const APrompt: String; |
MaskInput: Boolean; |
var Value: String |
):Boolean; |
const ACaption: String; |
const APrompt: String; |
var Value: String |
):Boolean; |
ACaption |
|
The caption for the dialogbox |
APrompt |
|
The text asking the user for his input. |
MaskInput |
|
Determines if the dialog shows *s or the actual input. |
Value |
|
The value the user entered. |
Result is True if the user pressed OK or hit RETURN in the dialog box. If the user pressed Cancel or the dialog was closed without pressing a button the result will be false.
ACaption |
|
The caption for the dialogbox |
APrompt |
|
The text asking the user for his input. |
Value |
|
The value the user entered. |
Result is True if the user pressed OK or hit RETURN in the dialog box. If the user pressed Cancel or the dialog was closed without pressing a button the result will be false.
Two versions of this function which displays a prompt and expects user input of textual data;
The first includes a MaskInput boolean argument
which determines whether the user input is masked out by asterisks in the text-input box
(like during entry of a password),
the second omits this property.
The text entered by the user is returned in the variable argument 'Value'. The function result is a boolean which returns TRUE if the OK button was pressed, or FALSE if the box was closed by any other mechanism (such as clicking the 'Close' icon on the top title bar).
Omitting the MaskInput argument is equivalent to setting it FALSE.
|
Displays a box with defined title and prompt, and expects user input in a text box |
|
|
Password Box |
Uses forms, lcltype, dialogs, controls; procedure TryInputQuery; var QueryResult: boolean; userstring: string; begin if InputQuery ('Question', 'Type in some data', TRUE, userstring) then ShowMessage (userstring) else begin InputQuery ('Don''t be silly', 'Please try again', userstring); ShowMessage (userstring) end end;
lazarus-ccr.sourceforge.net |