8.1. Create a Dialog Record

To store the values retrieved from a custom dialog box, you create a dialog record with a Dim statement, using the following syntax:

Dim DialogRecord As DialogVariable


Following are examples of how to create dialog records

Dim b As UserDialog

'Define a dialog record "b".

Dim PlayCD As CDDialog

'Define a dialog record "PlayCD".

Sample script

This sample script that illustrates how to create a dialog record named b within a dialog box template named UserDialog. Notice that the order of the statements within the script is as follows: the dialog box template precedes the statement that creates the dialog record, and the Dialog statement follows both of them.

Sub Main()
 Dim ListBox1$()     'Initialize list box array.

 'Define the dialog box template.
 Begin Dialog UserDialog ,,163,94,"Grocery Order"
   Text 13,6,32,8,"&Quantity:",.Text1
   TextBox 48,4,28,12,.TextBox1
   ListBox 12,28,68,32,ListBox1$,.ListBox1
   OKButton 112,8,40,14
   CancelButton 112,28,40,14
 End Dialog

 Dim b As UserDialog     'Create the dialog record.
 Dialog b         'Display the dialog box.
End Sub

More information

8. Use a custom dialog box in a script.