Dear Khaled,
(edit: nevermind)Do you expect that there should still be unresolved issues regarding simple nested while-loops (or if-checks) when scripted as single line code, or editbox code?
I don't recall if you declared these issues resolved or not.
Example:
tickstest1 {
var %n = 100, %max = 0, %ticks, %i
while (%n > 0) {
set %i 1
set %ticks $ticks
while ($ticks == %ticks) inc %i
if (%i > %max) set %max %i
dec %n
}
echo -a * tickstest1: n= %n , i= %i , max= %max
}
tickstest2 { var %n = 100, %max = 0, %ticks, %i | while (%n > 0) { set %i 1 | set %ticks $ticks | while ($ticks == %ticks) inc %i | if (%i > %max) set %max %i | dec %n } | echo -a * tickstest2: n= %n , i= %i , max= %max }
* tickstest1: n= 0 , i= 718 , max= 786
* tickstest2: n= 98 , i= 1 , max= 268
I've tried many many variants of the above code. while (%n) vs while (%n > 0), with and without { } for the inner /while, with and without the /if (%i > %max) code, using /set instead of /var, etc. I don't get any nested while loops to work on a single line, so I assume this was never resolved or marked as unfixable?
__
Edit: maroon found that wrapping /inc %i in { } braces makes the single-line code work. Some how I assumed that did not work for me either. So I guess my question is moot but I'll leave this here to the oddities encountered, and maroon's credit.
tickstest3 { var %n = 100, %max = 0, %ticks, %i | while (%n > 0) { set %i 1 | set %ticks $ticks | while ($ticks == %ticks)
{ inc %i } | if (%i > %max) set %max %i | dec %n } | echo -a * tickstest2: n= %n , i= %i , max= %max }