06-01-2022 09:53 PM
How does RunState.LoopIndex works? I have the following setup but Runstate.LoopIndex keeps initializing to 0 after first run.
If I use Locals.Index then for loop runs as expected.
Thanks!!
Solved! Go to Solution.
06-02-2022 04:22 PM
RunState.LoopIndex is only valid for the life of a step and then each step resets it back to 0.... at least that's how I understand it.
LoopIndex should only be used for looping within a single step and not for the flow control steps. You correct in using Locals for that.
From the Help:
SequenceContext.LoopIndex
Specifies the value of the loop index at a given point as a step loops. The value of the loop index depends on the looping construct you select for the step.
|
Note This property returns the value of the loop index truncated to a 32-bit integer. To retrieve the underlying 64-bit floating point loop index, call SequenceContext.AsPropertyObject().GetValNumber("RunState.LoopIndex", 0). |