DECREMENT Instruction

The DECREMENT instruction decreases the value of a Number variable you specify by 1.

DECREMENT is often paired with a WHILE Instruction where it is used to decrease a number every time the WHILE instruction is processed until a condition is met. It is also often used with the COUNTER function to reduce the COUNTER's current number of repetitions by 1, this can be useful when you want to use a COUNTER to number a list but that list needs to start at 0 rather than 1.

Instruction name Model After you drag and drop the model into the script tab:
DECREMENT DECREMENT ⟦NUM_VAR⟧ Replace ⟦NUM_VAR⟧ with the number variable you want HotDocs to decrease by 1.

Example

 A template author is creating a list in a document that needs to start at 0 rather than 1.

Within the Script tab in the x-axis computation, type the following (result is a local number variable):

SET result TO COUNTER

DECREMENT result

result

In the template, use the Field Editor to add the following instructions to the template:

[REPEAT Coordinates]

([x-axis], [y-axis])

[END REPEAT]

If the user provided 5, 7, and -5 for the y-axis, the resulting template is as below:

(0, 5)

(1, 7)

(2, -5)

Download

After you download the example template, you can import the template to any workspace to see this example code in action.