Previous Topic: Loop Through Indexed Elements of a Dataset FieldNext Topic: Loop Errors and Exceptions


Index the Loop Count for Other Purposes

You can track the iteration number during loop processing for accessing elements in an indexed dataset field, or for other purposes. Use a process variable for the index variable (for example, process.i). In an Interpreter module Calculation operator that precedes the looped operator, initialize the process variable to its starting value for the loop:

Process.i=1;

To increase the index variable after completing each iteration of the loop, use an expression on the Post-Execution Actions tab of the operator properties. For example:

Process.i=Process.i+1;

Note: This topic is considered no longer necessary; however, it is included for reference when working with legacy code.