Numerical conditions
The + syntax should be used in preference to the obsolete ? form.
| • | {+fieldname=['found'],['not_found'][[,initial_value],limit[,reset_value]]} |
The + condition field syntax, when given numerical values, may be used to set up a number of counting functions. Full nesting of conditional field expressions is supported, e.g.
{field1*field2}
{field1*2-field2}
{field1}{field2}
etc. as long as they resolve to a number.
| {+fieldname=found,,[initial_value][,limit[,reset_value]]} A counter that is incremented when a named field is found. |
For example: {+points=02,,03,12,01} Initially, composite field is set to the value 03. Each time the field named "points" is found, the composite field value is incremented by 01 until it reaches the value 12. The next time "points" is found, the composite field value is reset to 01. |
| {+fieldname=,not_found[,[initial_value],limit[,reset_value]]} A counter that is incremented when a named field is not found. |
For example: {+debit=,2,0} or |
| {+fieldname=found} A simple construct for counting found fields, where the initial value is null. |
For example: {+count=1} or |
Obsolete syntax:
| {fieldname=digits[,initial_value[,limit]]} This initializes and increments a counter: use +fieldname syntax above instead. |
When the specified field is encountered for the first time, the counter is set to initial_value, or 0 if that is not specified. Subsequently, if the field exists the counter is incremented until it reaches the limit (if any), when it is reset to the initial value. If digits parameter value is an integer and starts with a zero then leading zeros are inserted to make up the width, otherwise spaces are used. If digits parameter value is a number 'n' of # characters, then the width is specified as n characters. If the counter exceeds the specified width then it is not truncated and all digits are shown. Examples: Invoice {page1=1,1} Set{page1=02,0,99} To truncate the counter another composite field may be used. For example, you might use: |
Links