DIALOG command

Used to create custom dialog boxes that interactively prompt users for information.

Syntax

DIALOG (DIALOG TITLE title_text WIDTH pixels HEIGHT pixels)
(BUTTONSET TITLE "&OK;&Cancel" AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels>
DEFAULT item_num <HORZ>) <[label_syntax]|[textbox_syntax]|
[checkbox_syntax]|radiobutton_syntax]|[dropdown_list_syntax]|
[[project_item_list_syntax|> <...n>

 

label_syntax ::=
TEXT TITLE title_text AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels>
<CENTER|RIGHT>

 

textbox_syntax ::=
EDIT TO var_name AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels> 
<DEFAULT string>

 

checkbox_syntax ::=
CHECKBOX TITLE title_text TO var_name AT x_pos y_pos <WIDTH pixels> 
<HEIGHT pixels> <CHECKED>

 

radiobutton_syntax ::=
RADIOBUTTON TITLE value_list TO var_name AT x_pos y_pos <WIDTH pixels>
<HEIGHT pixels> <DEFAULT item_num> <HORZ>

 

dropdown_list_syntax ::=
DROPDOWN TITLE value_list TO var_name AT x_pos y_pos <WIDTH pixels>
<HEIGHT pixels> <DEFAULT item_num>

 

project_item_list_syntax ::=
ITEM TITLE acl_project_item_types AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels>
DEFAULT string

Parameters

TITLE "&OK;&Cancel"

Specifies the labels for the OK and Cancel buttons in the dialog box. The values should not typically be edited, but if you do edit the values you should ensure that the positive value (e.g., Yes) comes before the negative value (e.g., No).

TITLE title_text

Specifies the window title in the BUTTONSET control, or the control label for the CHECKBOX and TEXT controls. The text_title value must be specified as a quoted string.

TITLE value_list

Specifies the list of values displayed for the RADIOBUTTON and DROPDOWN controls. The values must be specified as a quoted string, with each value separated by a semi-colon (;).

TITLE acl_project_item_types

Specifies the types of ACL project items to include in the drop-down list. You can include one or more field name type (Table 1), one or more variable type (Table 2), or you can include multiple project item types (Table 3). You cannot mix field types, variable types, and project item types in the same ACCEPT command. The user can select a single value from the drop-down list. The value must be specified as a quoted string, with no punctuation between values.

AT x_pos y_pos

Specifies the location of the top left corner of the control on the form in pixels. The x_pos value is the horizontal distance from the left hand side of the form. The y_pos value is the vertical distance from the top of the form.

WIDTH pixels

Specifies the width of the individual control, or the width of the main form if specified for the DIALOG control. The value is specified in pixels. If no value is specified for a control the width is calculated based on the longest value for the control.

HEIGHT pixels

Specifies the height of the individual control, or the height of the main form if specified for the DIALOG control. The value is specified in pixels. If no value is specified for a control the height is calculated based on the longest value for the control.

DEFAULT string

Optional. Specifies the text string to display in a TEXT control, or the exact text of the default item to select in an ITEM control. The string value must be specified as a quotes string.

DEFAULT item_num

Optional. Specifies the numeric value that corresponds to the item in the list of values that you want to select as the default. For example, if the value_list defined for a DROPDOWN control is “Red;Green;Blue”, enter DEFAULT 2 to selected Green by default when the drop-down list is displayed.

HORZ

Optional. Specifies that the values for the BUTTONSET or RADIOBUTTON controls should be displayed horizontally. Values are displayed vertically be default.

CENTER|RIGHT

Optional. Specifies the alignment of the label text inside a TEXT control. Left is the default value, and you do not need to specify any value if you want left aligned text.

TO var_name

Specifies the ACL variable to use to store the value of the control. If the variable exists, the value of the control is assigned. If the variable does not exist, the variable is created and then the value of the control is assigned.

CHECKED

Specifies that the CHECKBOX control is checked by default.

Remarks

The DIALOG command is not supported in AX Server server scripts, or in ACL Server scripts.

The following tables list the ACL project item types you can use to populate drop-down lists.

Table 1. Field drop-down list entries
List item Item
C Character fields
N Numeric fields
L Logical fields
D Datetime fields
Table 2. Variable drop-down list entries
List item Item
c Character variables
n Numeric variables
l Logical variables
d Datetime variables
Table 3. ACL project item drop-down list entries
List item Item
b Scripts
f Tables
i Indexes
r Views and reports
w Workspaces

You cannot use non-English characters, such as é, in the names of variables that will be used in variable substitution. Variable names that contain non-English characters will cause the script to fail.

Example

The following example displays a dialog box that prompts the user to select the ACL table and script to use to run an analysis. The Metaphor_Inventory_2002 table from the ACL_Demo project is selected by default as the ACL table (line 4), but the user can select from any table in the project. The script to run must also be selected from the list of scripts in the ACL project (line 5).

DIALOG (DIALOG TITLE "Inventory analysis" WIDTH 500 HEIGHT 200 )
(BUTTONSET TITLE "&OK;&Cancel" AT 370 12 DEFAULT 1 )
(TEXT TITLE "Please choose the ACL project items to analyze." AT 50 16 )
(ITEM TITLE "f" TO "vTable" AT 50 65 DEFAULT "Metaphor_Inventory_2002" )
(ITEM TITLE "b" TO "vScript" AT 230 65 )
(TEXT TITLE "Table" AT 50 40 )
(TEXT TITLE "Script" AT 230 40 HEIGHT 31 )


(C) 2013 ACL Services Ltd. All Rights Reserved. | Send feedback