Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Grumpfish Library 3.2 - <b>waiton()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
WAITON()

    This function is handy for keeping the user of your application
    apprised of time-consuming operations, such as printing a report,
    instead of letting them stare at a blank screen and wonder what (if
    anything) is going on.

    Syntax

    WAITON([<message>] [,<sound>] [,<color>], [, <top>] [, <left>])

    Optional Parameters

    <message> is the message you wish to display. If you do not pass a
    message, WAITON() will assume that you are about to print a report
    and will display the message "Now printing... please wait".

    <sound> is a logical value.  If you pass True (.T.), WAITON() will
    emit two ascending tones when displaying the message and WAITOFF()
    will emit two descending tones when restoring the screen.

    These tones are scarcely trivial; if the time-consuming operation
    consumes enough time for the user to get up from their desk and do
    something else, the descending tones provided by WAITOFF() will
    alert them so that they can get back to work.  Pass False (.F.) if
    you do not want to use sound. (The default is sound on.)

    It is possible to have WAITON() be silent and WAITOFF() use the
    tones.  For more information, please refer to the WAITOFF()
    discussion.

    <color> is a character string representing the color in which to
    display the box.  The message will be displayed in the blinking
    version of this color.  For example, if you pass "W/B", the message
    will be displayed with "*W/B".  If you do not pass this parameter or
    pass a null string, the default will be yellow on black ("+GR/N").
    (5.0 NOTE: the same <color>, sans blinking, will be used for both
    the box and message.)

    <top> is a numeric representing the top row at which to draw the
    message box.  If you do not pass this parameter, WaitOn() will draw
    the box beginning at row 11.

    <left> is a numeric representing the left column at which to draw
    the message box.  If you do not pass this parameter, WaitOn() will
    automatically center the box horizontally on the screen.

    When the operation is complete, use the WAITOFF() function to
    refresh the screen:

    Return Value

    WAITON() does not return a value.  However, the following PUBLIC
    variables are initialized in WAITON() because WAITOFF() must make
    use of them to restore the screen: WAIT_LEFT, WAIT_RIGHT, and
    WAIT_SCRN. WAIT_LEFT and WAIT_RIGHT are the left and right columns
    of the message box, and WAIT_SCRN holds the screen buffer beneath
    the box.  They are released in WAITOFF().

    Sample usage

    USE Sales                             
    WAITON('Indexing file... please wait')
    INDEX ON lname+fname TO customer      
    WAITOFF()                             

    Clipper 5.0 Notes

    - WAITON() and WAITOFF() have been combined into one function
      (although the syntax for calling them remains exactly the same,
      thanks to the preprocessor). Therefore, you must put the following
      line at the top of any .PRG referring to WAITOFF():

      #include "grump.ch"

    - The PUBLIC variables have been replaced by STATICs.

    - WAITON() can now display more than one message. To make use of
      this feature, pass an array of character strings as the <message>
      parameter. The following line demonstrates this usage.

      waiton( {"Now printing...", "Go take a coffee break" } )

See Also: WAITOFF()

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