Display a simple modal dialog box

     ALERT( <cMessage>, [<aOptions>] ) --> nChoice


     <cMessage> is the message text displayed and centered in the alert
     box.  If the message contains one or more semicolons, the text after the
     semicolons is centered on succeeding lines in the dialog box.

     <aOptions> defines a list of up to 4 possible responses to the
     dialog box.


     ALERT() returns a numeric value indicating which option was chosen.  If
     the Esc key is pressed, the value returned is zero.


     The ALERT() function creates a simple modal dialog.  It is useful in
     error handlers and other "pause" functions.  The user can respond by
     moving a highlight bar and pressing the Return or SpaceBar keys, or by
     pressing the key corresponding to the first letter of the option.  If
     <aOptions> is not supplied, a single "Ok" option is presented.

     ALERT() is sensitive to the presence or absence of the Clipper
     full-screen I/O system.  If the full-screen system is not present,
     ALERT() uses standard I/O to display the message and options tty-style
     (i.e., 80-column, without word wrap, each line ended with carriage


     .  This example demonstrates use of an alert dialog box.  First,
        the array of options is defined, the ALERT() function gets the user's
        selection, and finally, the user's choice is handled with a DO
        CASE...ENDCASE control structure:

        #define AL_SAVE         1
        #define AL_CANCEL      2
        #define AL_CONT         3

        // Define an array of options
        aOptions := {"Save", "Don't Save", "Continue"}

        // Display the dialog box and get the user's selection
        nChoice  := ALERT("File has changed...", aOptions)

        // Handle the user's request
        DO CASE
        CASE nChoice == AL_SAVE
           ? "Save"
        CASE nChoice == AL_CANCEL
           ? "Don't Save"
        CASE nChoice == AL_CONT
           ? "Continue"
           ? "Escape"

 Files   Library is LLIBG.LIB.



One response to “C5_ALERT

  1. Pingback: C5 UI – Basics | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.