ERASE VAR; ERASE DIALOG
PlaceholderA marker in an instruction or expression model that indicates where a value must be substituted. This value must be a literal value or a variable. Instruction and expression models help the developer use the correct syntax in a script. |
Replace With |
VAR |
The name of a variableA component that is used to represent changeable text (such as names, dates, numbers, etc.) in the template. Types of variables include Text, Date, Number, True/False, Multiple Choice, Computation, and Personal Information. in a dialogIn template development, represents the component in which the developer groups variables and other components. In document assembly, represents the group of questions in the Interview tab of the assembly window where users enter their answers. you want to clear |
DIALOG |
The name of the dialog whose contents you want to clear |
The ERASE instructions let you clear answers in a dialog. Specifically, ERASE VAR clears answers for a specified variable in a dialog, while ERASE DIALOG clears all answers in the dialog. This may be useful when you are using a temporary dialog to store lists of answers from two or more dialogs.
For example, say you have two repeated dialogs—one containing plaintiff names and another containing defendant names. If you need to generate a single listTwo or more answers to one question merged in the document. of all parties in the case, you can combine the two lists into a single repeated dialog. To do this, you would want to erase any existing values from the combined list before populating it with the names from the plaintiff and defendant dialogs.
Using the ERASE instructionA command in a script or template that performs a special task, such as inserting a template or asking a dialog at a specific place in the interview. in the scriptOne or more instructions and/or expressions that generate a value or execute some kind of procedure. keeps the combined list up to date each time the computation script is processed. For example, if the userThe customer, client, or person who assembles documents from templates. (See also template developer.) adds or removes names in the plaintiff or defendant dialogs during the interviewA series of dialogs, each containing one or more questions which HotDocs generates from the variables you add to your template. The template's user must answer the questions in the interview before HotDocs can assemble a custom document. You can view the interview by clicking the Interview tab of the assembly window. The left pane of the assembly window displays an outline of the interview. As the user answers questions, the outline tracks the user's progress through the interview., the ERASE instruction will make sure they are properly added or removed when the combined list is regenerated.
The following script demonstrates how to accomplish this:
ERASE Combined List
SET CounterAn expression that keeps track of the current number of repetitions in a repeated dialog. Each time a new repetition is added, the COUNTER is increased. TO 0
REPEAT Plaintiff Information
INCREMENT Counter
SET Combined Name[Counter] TO Plaintiff Name
END REPEAT
REPEAT Defendant Information
INCREMENT Counter
SET Combined Name[Counter] TO Defendant Name
END REPEAT