Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>quit/cancel</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
QUIT/CANCEL


Syntax:     QUIT/CANCEL

Purpose:    To terminate program processing, close all open files, and
            return control to the operating system.

Usage:      QUIT or CANCEL can be used from anywhere in a program to
            terminate and return to the operating system.  A RETURN
            executed at the highest level procedure performs the same
            action.

            Return code: When a Clipper program terminates, the
            return code is set to either the current ERRORLEVEL()
            setting, the number of the last DOS error if one occurred,
            or zero.

Library:    CLIPPER.LIB


----------------------------------- Example --------------------------------

   The following example demonstrates a method of QUITting using a
   dialog box.

   IF YesNoBox(10, 10, "Quit to DOS",;
      "BG+/B,B/W", "W/N,N/W", 2)
      QUIT
   ENDIF

   RETURN


   FUNCTION YesNoBox
   PARAMETERS r1, c1, strng, c_box, c_restore, choice
   PRIVATE temp_scr

   r2 = r1 + 6
   c2 = c1 + LEN(strng)

   SAVE SCREEN TO temp_scr
   SET COLOR TO &c_box.

   @ r1, c1 CLEAR TO r1 + 6, c1 + LEN(strng) + 14
   @ r1, c1 TO r1 + 6, c1 + LEN(strng) + 14 DOUBLE
   @ r1 + 1, c1 + 3  SAY strng
   @ r1 + 3, c1 + 3 TO r1 + 5, c1 + 8
   @ r1 + 4, c1 + 4  PROMPT " Ok "
   @ r1 + 3, c1 + 10 to r1 + 5, c1 + 19
   @ r1 + 4, c1 + 11 PROMPT " Cancel "
   choice = IF(choice  1 .OR. choice  2, 1, choice)
   MENU TO choice

   SET COLOR TO &c_restore.
   RESTORE SCREEN FROM temp_scr

   RETURN (choice = 1)


See Also: RETURN

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson