SET VAR TO VALUE
Placeholder | Replace With |
VAR | Any variable |
VALUE | A value appropriate for the associated variable |
For a more detailed explanation of setting variables to values, see Automatically Assign Answers to a Variable.
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.
For example, if the plaintiff is the same as the client, you can use a SET instruction to automatically enter the plaintiff’s name as the client’s, saving the user from typing the name a second time:
IF Is Plaintiff Also Client
SET Client Name TO Plaintiff Name
END IF
The SET Instruction can also be used to set custom error messages in interview dialogs. Used with the ERRORTEXT expression in a dialog script, SET can be used to create conditional error messages to help minimise incorrect answers. To see examples of this method see ERRORTEXT.
Because HotDocs repeatedly processes SET instructions during the course of an interview , you must not let the user specify a different answer for a variable whose value is being SET. When HotDocs updates the interview, the user’s answer will be replaced with the value from the SET instruction. To suggest an answer for the user and allow them to change it, use the DEFAULT instruction. (See Differences Between SET and DEFAULT Instructions for an explanation.)
If you are grouping two or more child (inserted) dialogs in a parent dialog , you can SET the child dialog's status to TRUE. This forces the contents of the child dialog to automatically appear in the interview outline . (See Group Child Dialogs in a Parent Dialog for details.)
To set two or more options for a Multiple Choice variable, separate each option with a vertical bar (for example, SET MC Variable TO "Option1|Option2|Option3")