INCREMENT Instruction
The INCREMENT instruction increases (by 1) the value of a Number variable you specify.
INCREMENT is often paired with a WHILE Instruction where it is used to increase a number every time the WHILE instruction is processed until a condition is met, for example, you can use an INCREMENT instruction to keep track of how many repetitions of a dialog HotDocs has processed. It is also often used with the COUNTER function to increase the COUNTER's current number of repetitions by 1; this can be useful when you want to use a COUNTER starting at 2 rather than 1.
Instruction name | Model | After you drag and drop the model into the script tab: |
INCREMENT | INCREMENT ⟦NUM_VAR⟧ | Replace ⟦NUM_VAR⟧ with the Number variable want HotDocs to increase by 1. |
Example
In the following example, you want to create a list of potential employees. However, you want the list to include only those applicants with four or more years of schooling. To do this, you would use the WHILE instruction to loop through a list of applicants. You would then use the INCREMENT instruction to keep track of which repetition you are on so that the correct information can be merged into a new list.
SET Applicant Count TO 1
SET Prospect Count TO 0
WHILE ANSWERED( Applicant Name[Applicant Count] )
IF Applicant Years of Schooling[Applicant Count] >= 4
INCREMENT Prospect Count
SET Prospect Name[Prospect Count] TO Applicant Name[Applicant Count]
END IF
INCREMENT Applicant Count
END WHILE