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>yes_no2()b</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
YES_NO2()B

    YES_NO2() is a somewhat involved variant upon YES_NO().  The basic
    difference between the two functions is that YES_NO2() uses a
    light-bar menu with 'Yes' and 'No' as the two choices.  However, it
    is also more configurable than YES_NO().  For example, you can
    specify alternative yes and no messages, such as "OK" and "Cancel".

    Since YES_NO2() operates with the light-bar menu, you may also
    specify which option should be initially highlighted.  This is
    useful when you want to lead the user in a certain direction.  For
    example, if they are about to zap a database, you would probably
    want to highlight the "No" choice to prod them back along the road
    to safety.  The syntax is:

    YES_NO2(<question>, [<top row>, <yes prompt>, <no prompt>, <init_val>,
            <box color>, <option color>])

    Required Parameter

    <question> is a character string representing the message you wish
    to display.

    Optional Parameters

    <top row> is a numeric representing the top row at which to draw the
    box.  The default is 20. (NOTE: the 5.0 box will automatically be
    centered vertically on the screen.)

    <yes prompt> is a character string to use for the yes prompt.  The
    default is " Yes ".

    <no prompt> is a character string to use for the no prompt.  The
    default is " No " (surprise surprise!).

    <init val> is a logical value that indicates which prompt should be
    initially highlighted.  Pass True (.T.) to highlight the "Yes"
    prompt, or False (.F.) to highlight the "No" prompt.  The default is
    True ("Yes").

    <box color> is a character string representing the color with which
    to draw the box outline and the question.  The default is high
    intensity white on magenta. (As you probably have ascertained by
    now, I am quite fond of magenta!)

    <option color> is a character string representing the color with
    which to draw the menu prompts.  The default is white on magenta for
    the unselected option, and reverse video (black on white) for the
    selected option.

    Return Value

    YES_NO2() returns a logical value: True (.T.) if the user selected
    the "Yes" option, or False (.F.) if the user selected the "No"
    option or pressed Esc.

    Sample usage

    IF YES_NO2('Reindex all files?')
       REINDEX                      
    ENDIF                           

    IF YES_NO2('Shall I self-destruct now?', 20, " OK     " Cancel     .F.)
       kill_pc()   && an Assembler routine written by an evil Apple lover
    ENDIF                                                                

   Clipper 5.0 Notes

   YES_NO2() can 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.

   yes_no2( {"You have two choices", "Either YES or NO", "Take your pick"} )

See Also: YES_NO()

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