The implementation described in this topic is done in addition to the implementation described in Recorded loop: Non-iterative case.
The loop index variable (in contrast to the required loop variable described in Recorded loop: Non-iterative case) prevents a While loop from running through more iterations than there are instances of an Extract variable.
The loop recorder (the host editor) creates the loop index variable when you select Extract data every iteration of the loop in the Select Variable window. The data type of the loop index variable is integer. The name is formed by adding the suffix _index to the name of the loop variable that you specified, for example LoopVar_index.

In the init node a second mapping is added to initialize the loop index variable to 0 (see Init node, While node, and parse node).
(v_Dfh0xs1_Exmenu_Exmenu.strLoopVar = 'TRUE') AND (v_Dfh0xs1_Exmenu_Exmenu.strLoopVar_index < 8)
The
value for the maximum number of iterations is the value that you specify
in the Maximum number of iterations field of
the Select Variable window (see Maximum number of iterations).In the parse node another output terminal is added (as the first output terminal) to handle the case in which the While node terminates the loop because the maximum number of iterations is exceeded.
The flow of control goes out of the parse node through this output terminal if the recognized screen is the Begin Loop screen. (The reasoning for this design is that if the While loop terminates and the Begin Loop screen is displayed, rather than the Exit Loop screen, then the While node must have terminated the loop because the maximum number of iterations was exceeded.)
Because an error condition exists (the loop is terminated because the maximum number of iterations is exceeded) the connection from the first output terminal goes directly to the Reply node, or to the Assign node immediately preceding the Reply node if any (as in Figure 1).
The following changes are made in the invoked flow:

v_Dfh0xs1_Exmenu_Exmenu_33.strLoopVar_index

("EndPage"."INQ2-DESC" IS NOT NULL) AND ("v_Dfh0xs1_Exmenu_Exmenu_43"."variable0_index" <= 8)
Thus
at runtime the Extract action for the Exit Loop screen
is not performed if the value of the loop index variable is too great.The Extract mapping is stored in the output terminal of the parse node that connects to the input terminal of the Invoke screen operation node for the Exit Loop screen. (The mapping to implement an Extract action is stored in the mapping routine of an output terminal of the preceding Invoke screen operations node or Assign node -- see Implementation of Extract actions and Insert actions.)