The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




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?)


Messages In This Thread
for in combination with goto (probably not bug). - by r0n - 03-18-2021, 08:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)