Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>alert() replacement</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Alert() replacement
------------------------------------------------------------------------------

 Syntax

         GT_Alert(<aMss>, <aOpts>, <lSave>, <aColour>) --> nChoice

 Arguments:

       <aMss>     - An array of messages
       <aOpts>    - An array of prompts / choices for the alert
       <lSave>    - .T. if we need the screen saving and restoring
       <aColour>  - Colour Spec Array
                      1st element, border & normal text & unselected prompt
                      2nd element, selected prompt

 Returns:

       nPos       - The prompt/choice selected otherwise 0 if escape was
                    pressed

 Description:

       The GT_Alert() function creates a slightly less simple dialog
       than the standard Alert() function.  Use it wherever you would
       Alert().

       It has a number of differences / advantages over the standard
       alert().

       These are
          .  Optional saving/restoring of the screen area.
          .  The message is passed as an array of character strings
          .  GT_Alert() can check the setkey handler.

       KNOWN PROBLEMS
          Does not check setkey handler yet - read the code
          Spacing of prompts look poor in some cases.
          These problems are known and will be fixed RSN

          These problems have now been fixed.
          If you find any more please report the,

       CAVEATS
       .  Does not check that the elements in the arrays are character
          strings
       .  Does not check that the prompts will fit on the machine


 Examples:

          .
          .
          nChoice := GT_Alert( { "GT Example System",              ;
                                 "Do You Want To Quit" },          ;
                               { "Yes", "No", "Not Sure"}, TRUE)

          do case
             case nChoice == 1
                ? "You have chosen to quit"
             case nChoice == 2
                ? "You have chosen not to quit"
             case nChoice == 3
                ? "Make up your mind"
             otherwise
                ? "Escape pressed"
          endcase


 Source: GT_ALERT.PRG

 Author:  Andy M Leighton

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