; Exiting a For...Next loop by changing the value of the loop variable For i.w=0 To 10 NPrint "First loop, counting: ",i ; We will quit this for loop when the count has reached 5 If i=5 Then i=10 Next ; Exiting another type of loop using the loop expression as is i = 0 Repeat NPrint "Loop2, counting: ",i i=i+1 If i=7 NPrint "Exiting loop" i = 10 EndIf Until i=10 MouseWait End