Syntax |
COUNTER([Start value][,End value] [,Step size] [,Number of positions] [,Leading zeroes]) |
Description |
A counter which by default counts from the first to the last record. Arguments are optional. |
Example |
COUNTER (1,100) COUNTER (1,100, 5, 3, True) COUNTER (1, 100, 0.5, 3, False) COUNTER() |
Start value |
The start value of the counter. Default 1 . |
End value |
The end value of the counter. Default 10000000000. |
Step size |
The step size to the next number. Default 1. |
Number of positions |
The number of characters the counter will create. By default no extra characters will be added. Default 0. |
Leading zeroes |
True for leading zeroes, False for no leading zeroes (default). |
You can use a counter when printing tickets or numbering your mailing. You do not need to open a database within PrintShop Mail when using a COUNTER, if this is the only variable.
The first example creates numbers, starting with 1 and ending with 100. As you browse through the fields of the database, the series is as follows:
1, 2, 3, 4, ..., 99, 100, 1, 2, 3, ...
The counter restarts once it has reached 100.
The series generated by the second example looks like this:
001, 005, 010, ..., 090, 100, 005, 010, ...
The parameters step size, number of positions and leading zeroes have been added.
The third example has a fraction for the step size. This means that the counter increases by 0.5.
1, 1.5, 2, 2.5, 3, ..., 99.5, 100, 100.5, ...
The last example, COUNTER() starts with 1 and ends at whatever number is set in Items without database (Program settings in the Preferences).