Control Structures
ForEachIndex()
This function runs in a loop over all integer counter values from a given start value to a final value. A macro expression is executed for each counter value.
Parameter | Data Type | Description |
|---|---|---|
1* | Number | Initial integer of the counting loop |
2* | Number | Final integer of the counting loop The final value must be greater than or equal to the initial value. |
3* | (None) | Macro expression executed for a each counter value The value itself is addressed in the expression via the |
Examples
For example, the following macro expression adds up the counter values from 1 to 10 in a field “Sum,” which has an initial value of 0 and a final result of 55:
ForEachIndex(1, 10, @Sum = @Sum + @Index)
SetCanceled(), SetError(), SetSuspended()
These functions set the current document to the status "Canceled," "Error," or "Suspended," immediately halting further processing of the document.
Notice
In the input step, no distinction is made between different abort statuses. A processing error or a user-defined abort forced by a macro always results in this step in a batch not being able to be read in and being set to "Error" status.
These macro functions should therefore only be used in the processing and output steps.
Parameter | Data Type | Description |
|---|---|---|
1 | Text | Custom text output together with the corresponding status and log message (optional) |
Examples
SetError("Custom error message.") cancels document processing with a custom error message.
SetDeferred()
This function sets the current document to the status "Deferred," immediately halting further processing of the document. This may only be a temporary stop.
Notice
In the input step, no distinction is made between different abort statuses. A processing error or a user-defined abort forced by a macro always results in this step in a batch not being able to be read in and being set to "Error" status.
This macro function should therefore only be used in the processing and output steps.
Parameter | Data Type | Description |
|---|---|---|
1* | Text | Time period for which the document is deferred, in the syntax of a |
2 | Text | Custom text output together with the corresponding status and log message (optional) |
Examples
SetDeferred("30m", "Custom message.") defers document processing for 30 minutes.