Demivec wrote: Thu Jun 06, 2024 7:55 am
@threeslider: The important question is, why would you need the value of the loop control variable after the loop? If you are using the variable as a check to see whether a condition was met during the loop you could set a status variable to either #True or #False.
Your code examples don't really provide enough detail to recommend a more detailed solution. At the very least, pseudo-code outlining the purpose of the loops and the basis of their range of values would be very helpful.
A simple recommendation with your last approach is that if there were no commands before breaking out of the outer loop you could then just use 'Break 2' to leave both the inner loop and outer loop if n equals 2.
Sorry if it is not useful but...
Well I do for small test to understand with loop, and it is somewhat confusing for me because I do my project for Raytracing in one week end, I don't want to put the whole source code here

So to simplify I have a quirky behavior in my code from Raytracing, dunno if it is me or PB

Can we have both the behavior to "<" and "<=" in PB ?
It seems for loop in PB with "To" has a behavior to "<=", right ? And when I do as my code in Raytracing is another story (now it is "If" and "ElseIf" problem ... I want to the same in loop for similar behavior but not working)