Skip to main content

Dial_GetButton (function reference)

By November 1, 2020June 23rd, 2021Online Help, Troi Dialog Plug-in
Troi Dialog Plug-in for FileMaker Pro

Dial_GetButton

Returns the number of the button clicked in the last dialog shown.

SyntaxFunction badge

Dial_GetButton ( switches )

Parameters

none please leave empty for future use

Returned Result

Data type returned

Text

Result

The number of the button clicked in the last dialog shown.

Originated in

Troi Dialog Plug-in 3.0

Compatibility

FileMaker Pro 16 to 19

Considerations

This function makes it easy to get the button number of a dialog that returns multiple results.

The button number is saved by the plug-in until a next dialog is displayed. Please be aware that each dialog function of the plug-in resets the number. Dialogs that have no buttons will set the button number to 0. (This is to be able to extend the functionality of these functions in the future).

When the FileMaker application stops, the saved button number is reset to 0.

See also the function Dial_GetInput.

Example

Set Field [ gUserChoice ; Dial_GetButton ( "" ) ]

This will return the number of the button clicked, for example 3.

Example 2

This example will show a password dialog. We assume that in your FileMaker file the following field is defined:

result     	Global, text

Add the following script steps:

Set Field [ result ; Dial_InputDialog ( "-StopIcon -StartField2 -Bullet2" ; 2 ;
                            "Please enter your name and password:" ; "OK" ; "Cancel" ) ]
If [ Dial_GetButton ( "" ) = 1 and Dial_GetInput ( "-text1" ) = "sesame" ]
  ... do your secret stuff here...
End If

Used in example files

Dialog.fmp12
Input.fmp12
ListDialog.fmp12

Related functionsFunction badge

Dial_BigInputDialog
Dial_Dialog
Dial_GetButton
Dial_GetInput
Dial_InputDialog
Dial_ListDialog

Related topics

Troi Dialog Plug-in online help (overview)


Online Help Page for Troi Dialog Plug-in for 16 to 19 –> Dial_GetButton (dialp4304) 2021-0623 15:49:42