Special Instructions for Dialog Scripts

Dialog scripts should only change the appearance of variables in a dialog — they should not be used to compute answers. A dialog script may be run any number of times, with no guarantee that an answer will only be computed once.

The following is a brief explanation of instructions that can be used in dialogs. In each of the following examples, either replace the placeholder NUM with a number value, or replace VAR with a variable name:

Instruction Description
CONCEAL VAR This instruction, which you use in a dialog script, keeps variables from appearing in the Select From Answer Source dialog box of an answer source.
DEFAULT VAR TO VALUE This instruction suggests a value for a variable if the variable is unanswered.
ERRORTEXT This instruction allows you to create an error message that can appear during the interview.
GRAY ALL; GRAY VAR; UNGRAY ALL; UNGRAY VAR These instructions, which are used in a dialog script, control whether components in a dialog appear grayed or ungrayed, depending on answers a user enters. GRAY ALL dims all components in the dialog, while UNGRAY ALL makes all of the components active again. Likewise, GRAY VAR dims a single component, and UNGRAY VAR enables the component again.
HIDE ALL; HIDE VAR; SHOW ALL; SHOW VAR These instructions, which are used in a dialog script, control whether the user is able to see variables in a dialog. The HIDE ALL instruction hides all variables in the dialog, while SHOW ALL reveals the variables again. Likewise, HIDE VAR hides a single variable, and SHOW VAR reveals the variable.
LIMIT NUM The LIMIT instruction limits the number of times a dialog can be repeated. It is placed in the script of the dialog that must be limited to a specific number of repetitions.
OMIT VAR The OMIT VAR instruction, which you use in a dialog script, keeps variables from appearing in the Edit Answer Source dialog box of an answer source.
REQUIRE ALL; REQUIRE VAR The REQUIRE instruction requires users to answer questions in a dialog before they can advance to the next dialog in the interview.
SET VAR TO VALUE This instruction lets you specify a given value for a variable’s answer automatically, rather than allow the user to specify an answer. With the SET instruction, you can transfer names and other values from one variable to another.