GetTrueFalse
The GetTrueFalse function opens a dialog showing a true orfalse choice to be made. This function returns the choice and the button that was clicked. All text labels can be configured or defaults can be used.
|
|
bTrue, bOK = GetTrueFalse()
bTrue, bOK = GetTrueFalse( bInit )
bTrue, bOK = GetTrueFalse( bInit, sLabels )
bTrue, bOK = GetTrueFalse( bInit, sLabels, sPrompt )
bTrue, bOK = GetTrueFalse( bInit, sLabels, sPrompt, sTitle )
bInit is the initial choice (true or false). If omitted, false is assumed.
sLabels is the list of 2 choice labels, separated by \n. If nil, "True" and "False" are used.
sPrompt specifies a message above the choices. If nil, a default prompt is used.
sTitle specifies the window title. If nil, a default is used.
bTrue is the user's choice of True or False.
If [OK] is clicked, the function returns bOK=true.
If the dialog is canceled bOK is false and bTrue is false.
Note that the position of the default value and the label string is reversed in comparison with GetChoice and GetItem dialogs. This is done so that only the initial true/false value need be specified.
All arguments following sLabels are optional. Defaults are used beyond the last specified argument. To use a default argument but follow it with a specified argument, use a nil in its place.
The sLabels argument specifies the strings to be used for the 2 bullet labels. These labels are specified in one string separated by a new line character \n, with the true label first. For example, to specify the labels as "The True Choice" and "The False Choice", pass the sLabels argument as
The choice is returned as bTrue = true or false. The user's button click is returned as bOK. If [OK] is clicked then bOK=true. Otherwise, if the user clicks [Cancel], then bOK=false.
The upper window shown above was created using mostly the defaults:
|
-- initial choice is specified |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.