GetChoice GetItem

GetTrueFalse


The GetTrueFalse function opens a dialog showing a True or False 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( bInit=false, sLabels=nil, sPrompt=nil, sTitle=nil )

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