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 )

    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.

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