Building the Syntax Template

The syntax template specifies the command syntax to be generated by the custom dialog. It might consist of static text that is always generated and control identifiers that are replaced at run time with the values of the associated custom dialog controls.

Figure 1. Custom Dialog Builder showing syntax in the Syntax Template pane
Custom Dialog Builder showing syntax in the Syntax Template pane

For example, for a custom dialog that generates command syntax for a single command--such as in the current example--the command name is static text. The set of variables specified in a target list--such as the list of dependent variables--is represented with the control identifier for the associated target list control.

To build the syntax template for the Simple One-Way ANOVA dialog:

  1. Enter ONEWAY in the edit window of the Syntax Template pane and then enter a space.
  2. Select the Dependent List control on the canvas, right-click and select Add to syntax template. This action inserts the identifier %%dependent_list%% at the current cursor position.
    • At run time, the control identifier %%dependent_list%% will be replaced with the syntax generated by the Dependent List control, which was specified to be the list of variables transferred to the control.
    • If you choose to enter control identifiers manually, remember to include the double percent signs (%%) before and after the identifier.
    • The edit window of the Syntax Template pane supports the auto-completion and color coding features of the Syntax Editor. See the topic Using the Syntax Editor for more information.

    Fill in the rest of the syntax template.

  3. Add the keyword BY after the identifier for the Dependent List control and then add the identifier for the Factor control.
  4. On a new line, insert the identifier for the Statistics group of check boxes.
  5. On a new line, enter /MISSING and then insert the identifier for the Missing Values radio button group.

    At run time, the identifiers will be replaced by the syntax generated by the associated controls, as specified by the syntax properties of the controls.

    • %%factor%% will be replaced with the single variable transferred to the Factor control.
    • %%statistics%% will be replaced with /STATISTICS followed by a blank-separated list of the syntax generated by each of the checked boxes in the Statistics group.

      If no boxes are checked, then no syntax is generated by the Statistics group and the identifier %%statistics%% is replaced with an empty string.

    • %%missing%% will be replaced with the syntax associated with the selected radio button from the Missing Values control, either ANALYSIS or LISTWISE.

    For example, the following user choices generate the displayed syntax:

    • The single variable performance is transferred to the Dependent List control.
    • The variable group is transferred to the Factor control.
    • The Descriptive and Welch boxes are checked in the Statistics group on the Options sub-dialog.
    • Exclude cases listwise is selected for the Missing Values radio group on the Options sub-dialog.
    ONEWAY performance BY group
      /STATISTICS DESCRIPTIVES WELCH
      /MISSING LISTWISE.

Next