08-24-2022, 05:50 AM
You EXIT FOR, which moves the program flow at that point to after the NEXT statement. The GOTO never executes.
For x& = 1 To 10
Print x&
If x& = 5 Then Exit For: GoTo stuff
Next x&
PRINT x& ' As you can see here, x& is 5, so you did indeed EXIT the FOR loop.
Print "done"
For x& = 1 To 10
Print x&
If x& = 5 Then Exit For: GoTo stuff
Next x&
PRINT x& ' As you can see here, x& is 5, so you did indeed EXIT the FOR loop.
Print "done"