Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

Exit

This command works only within a loop. It immediately exits the loop and continues the program with the statement following the loop-closing command (ENDDO, ENDFOR/NEXT, or ENDSCAN).

We don’t use EXIT except in a few closely controlled circumstances because it makes code too hard to maintain. This is a “Beam me up, Scotty” command which can lead to spaghetti code.

See Also

Do While, For, For Each, Loop, Scan