You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a variable is defined in a for, while, or range loop which does not run because (a) the list is empty (b) the condition is initial false, or (c) the integer is less than or equal to zero, it will be transformed upon leaving the (un-run) loop and consequently defined. This is because STransforms are added as SStage(entry, loop, exit), and the entry and exit blocks, which contain the STransforms, run regardless of the condition. This can be fixed by refactoring the While, Range, and For types to include the entry and exit conditions, and only running them if the condition is true/valid. A basic example is:
If a variable is defined in a for, while, or range loop which does not run because (a) the list is empty (b) the condition is initial false, or (c) the integer is less than or equal to zero, it will be transformed upon leaving the (un-run) loop and consequently defined. This is because STransforms are added as SStage(entry, loop, exit), and the entry and exit blocks, which contain the STransforms, run regardless of the condition. This can be fixed by refactoring the While, Range, and For types to include the entry and exit conditions, and only running them if the condition is true/valid. A basic example is:
The text was updated successfully, but these errors were encountered: