9.8. Accessing Local Labels of For / While loops

By placing a label in front of a for or a while loop, a label scope array is created. This way you can access the inner labels of a loop from the outside or the labels of one loop from another loop:

        .for (var i=0; i<20; i++) { 
            lda #i 
            sta loop2[i].color+1 
        }

loop2:  .for (var i=0; i<20; i++) { 
color:      lda #0
            sta $d020 
        }