question about a loop and for-to

BlitzMax Forums/BlitzMax Beginners Area/question about a loop and for-to

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

The example was showing the feature of the Exit command where you can jump out to a specified level using labels: But labels are not required if you just want to exit the current loop.

Label2 is not used in that particular example, but it could be:

Strict
Local k,j
#Labell
For k=1 To 4
      #Label2
      For j=1 To 4
            Print k+ "," +j
            If k=3 Exit Labell
            If j=3 Exit Label2
      Next
Next


The label just marks the start of the loop to exit from. BTW, the Exit command does not jump TO that label, but to the end of that loop (Next).

Russell