Create a REPEAT Instruction Using a Computation Variable
Instead of inserting a REPEAT instruction directly in a template to generate a list of answers, you can use a REPEAT instruction in a Computation variable to create your list of answers. Using a computation enables you to quickly insert a list in more than one location in the template.
A drawback to this approach is that HotDocs applies punctuating, sorting, and filtering wherever you insert the computation—the list appears exactly the same even in different parts of your assembled document. For example, you would be unable to a display a list of cities in a column at the beginning of the template and then as a punctuated sentence later on.
To use a REPEAT instruction in a computation
- Script
When you use a script to merge a list of answers you have gathered using a REPEAT, you must first set the computation to a starting value. You must make this value a "" which represents “nothing” if the RESULT expression resolves to text, or a zero (0) if the RESULT expression resolves to a number.)
""
REPEAT Tour Information
RESULT + Name of City + ", " + Venue + "
"
END REPEAT