jonny foster
New Member
Hello, im using a for next loop and im trying to use the exit command to terminate the loop early. I expected after the exit command was used it would jump to the line after the for next loop, but it seems to jump right back to the start! Here's the code:
label_1:
let w6 = w6 + 10
let outpins = %00000000
for b27 = 0 to 40 STEP 2
get b27, word w7 if w7 = 0 then exit
next b27
high 1
put b27, word w6
goto eoc
eoc:
Since w7 does = 0, I was expecting it to jump to "high 1" after the loop but it jumps all the way back to label_1 when i simulate it in the programming editor :s, might be being an idiot here, sorry if thats the case , thanks for any help anyway.
label_1:
let w6 = w6 + 10
let outpins = %00000000
for b27 = 0 to 40 STEP 2
get b27, word w7 if w7 = 0 then exit
next b27
high 1
put b27, word w6
goto eoc
eoc:
Since w7 does = 0, I was expecting it to jump to "high 1" after the loop but it jumps all the way back to label_1 when i simulate it in the programming editor :s, might be being an idiot here, sorry if thats the case , thanks for any help anyway.