CANCEL Command Example

The following example simulates a program execution loop. Each time through the loop you are asked if you want to continue. If you press the Cancel button, CANCEL stops program execution.

DO WHILE .T.
   IF MESSAGEBOX("Do you want to continue?",36) <> 6
      CANCEL
   ENDIF
ENDDO