Advanced repeating spans

You are not restricted to just using a variable in the repeat statement. You can use any expression that results in a whole number value:
Repeat
whole-number-expression
For example, if you want to repeat exactly 5 times:
Repeat 5

Repeat range

The whole number form above, although the most common, is really just a short hand for:
Repeat
1
To
whole-number-expression
You can use this more explicit form to control the starting number of the first iteration of the repeat as it too can be any whole number valued expression:
Repeat
start-whole-number-expression
To
finish-whole-number-expression
For example, you may wish to distinguish the first 3 borrowers from any others (if there are any):
Repeat 1 To Smaller( NumberBorrowers, 3 )
Repeat 4 To NumberBorrowers

Repeat text

Finally there is another form of repeat, which is to repeat over a list of texts:
Repeat
text-list-expression
For example, consider a multi-select variable
CompanyShareClasses
having the options:
Class A
Class B
Class C
Class D
Class E
We may like to ask for each type of share, how many are available. The answers to the multi-select variable could be used to form a repeat span using the statement:
Repeat CompanyShareClasses
If the questionnaire user chooses:
Class A
Class C
Class D
then the span will be repeated 3 times. In the 1st iteration of the span the
RepeatCounter
will have the text value "Class A", in the 2nd iteration it will have the text value "Class C" and in the 3rd iteration it will have the text value "Class D".
Another way to look at repeats in general is that it always operates over lists, since "1 to 4" is just an expression that evaluates to the list of whole numbers 1, 2, 3, 4.