Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for in combination with goto (probably not bug).
#1
Probably not bug and probably intended but I just ask just to be sure.

If I have a for loop with an goto, if I skip (goto) at the end to part which has no code, the iteration cycle halts/stops.
But if I skip to a final part which still has code then the loop continues.
Sorry diffucult to explain:
case 1: Run below code and only 1 iteration is executed.
case 2: Enable last commented line and now code iterates 10 times.

(note, the c0 is within the loop so I assume the loop should continue...?)

Macro Macro10
Code:
Copy      Help
int i
int x=7
for i 0 10
,out F"output i: {i}"
,if(x!=0)
,,goto c0
,out F"output i again: {i}"
,;c0
,;; out "test" ;; If you activate this line then code iterates as normal, but if you deactivate this line iteration halts (exits?)
#2
It can be considered a bug, but now too late to fix.
#3
Ok! No problem, no haste required.
Just wanted to know to know for sure.
Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)