Break and Continue

More
02 Aug 2021 15:23 #216707 by Roguish
Break and Continue was created by Roguish
Hey, all,

does anyone have an actual coded example of using BREAK or CONTINUE in a loop or conditional?

thanks.
 

Please Log in or Create an account to join the conversation.

More
02 Aug 2021 19:26 #216738 by MaHa
Replied by MaHa on topic Break and Continue
There are 2 examples with BREAK and BREAK/CONTINUE with M0 in the loop, by pressing button 's' to continue, you can have a look at the debug notification.

#222 = 0
o100 WHILE [1]
M0
#222 = [#222 + 1]
(debug,Loop 222=#222)
o101 IF [#222 GE 7]
o100    BREAK
o101 ENDIF
o100 ENDWHILE
(debug,end Loop 222=#222)
 
 
#333 = 0
#334 = 0
o200 WHILE [#333 LT 19]
M0
#334 = [#334 + 1]
(debug,Loop 333=#333 334=#334)
o202 IF [#334 GE 16]
o200 BREAK
o202 ENDIF
o201 IF [#333 GE 10]
o200    CONTINUE
o201 ENDIF
#333 = [#333 + 1]
o200 ENDWHILE
(debug,end Loop 333=#333 334=#334)
M30
 
Attachments:

Please Log in or Create an account to join the conversation.

More
02 Aug 2021 20:14 #216745 by Roguish
Replied by Roguish on topic Break and Continue
THANK YOU HEAPS...........

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum