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.

 

Syntax

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 )

bullet.gif    bInit is the initial choice (true or false). If omitted, false is assumed.

bullet.gif    sLabels is the list of 2 choice labels, separated by \n. If nil, "True" and "False" are used.

bullet.gif    sPrompt specifies a message above the choices. If nil, a default prompt is used.

bullet.gif    sTitle specifies the window title. If nil, a default is used.

bullet.gif    bTrue is the user's choice of True or False.

bullet.gif    If [OK] is clicked, the function returns bOK=true.

bullet.gif    If the dialog is canceled bOK is false and bTrue is false.

Remarks

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 True Choice\nThe False Choice".

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.

Example

The upper window shown above was created using mostly the defaults:

 

  bTrue, bOK = GetTrueFalse( true )

-- initial choice is specified

Related Topics

GetItem, GetChoice


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.