Programming Reference Manual
 
Syntax
 
Dialog dialogvar[, default]
-or-
Dialog(dialogvar[, default])
 
Description
Display the dialog associated with dialogvar. The initial values of the dialog fields are provided by dialogvar. If the OK button or any push button is pressed then the fields in dialog are copied to the dialogvar. The Dialog( ) function returns a value indicating which button was pressed. (See the result table below.)
 
Parameter
Description
dlgvar
This variable that holds the values of the fields in a dialog. Use .field to access individual fields in a dialog variable. 
default
This numeric value indicates which button is the default button. (Pressing the Enter key on a non-button pushes the default button.) Use -2 to indicate that there is no default button. Other possible values are shown the result table below. If this value is omitted then the first PushButton, OKButton or CancelButton is the default button.
 
Result
Description
-1
OK button was pressed.
0
Cancel button was pressed.
>0
Nth push button was pressed.
See Also
Example
 
Sub Main
Dim Result As Integer
         Begin Dialog UserDialog 200,119,"Test dialog" ' %GRID:10,7,1,1
                 Text 10,10,180,15,"Please push any button"
                 OKButton 110,91,80,21
                 CancelButton 10,91,80,21
                 PushButton 10,35,80,42,"PushButton1",.PushButton1
                 PushButton 110,35,80,42,"PushButton2",.PushButton2
         End Dialog
    Dim dlg As UserDialog
    Result = Dialog(dlg) ' show dialog (wait for button press)
    Msgbox "Result: " & Result
End Sub