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>menu to</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
MENU TO


Syntax:     MENU TO <memvar>

Purpose:    To execute a light-bar menu for the currently defined set of
            PROMPTs.

Argument:   <memvar> is where MENU TO places the result of the
            selection process.  If the memory variable does not exist,
            MENU TO creates it as numeric type.  If it does exist, MENU
            TO uses it to determine which of the pending PROMPTS should
            initially be highlighted.

Usage:      MENU TO is the selection mechanism for the Clipper light-bar
            menu system.  Before executing it, first define the menu
            PROMPTs and associated MESSAGEs and define the associated
            MESSAGEs with a series of @...PROMPT statements.  Then
            activate the menu with MENU TO <memvar>.  If the <memvar>
            does not exist MENU TO creates it and places the highlight
            on the first PROMPT.  If it does exist, its value determines
            the first PROMPT highlighted.

            Color: PROMPTs are painted in the current standard
            color.  The highlighted PROMPT appears in the current
            enhanced color.

            Navigation and selection: Pressing the arrow keys moves
            the highlight to the next or previous PROMPTs.  As each
            PROMPT is highlighted the associated MESSAGE displays on the
            row specified with SET MESSAGE.  If WRAP is ON, an Uparrow
            from the first PROMPT moves the highlight to the last
            PROMPT.  Likewise, a Dnarrow from the last PROMPT moves the
            highlight to the first prompt.  To make a selection, press
            Return or the first character of a PROMPT.  MENU TO then
            returns the position of the selected PROMPT as a numeric
            value into the specified memory variable.  Pressing Esc
            terminates the menu without making a choice and returns
            zero.  The following table summarizes the active keys within
            MENU TO:


            Table: MENU TO Active Keys
            ---------------------------------------------------------------
               Key            Action
            ---------------------------------------------------------------
               Uparrow        Previous PROMPT
               Dnarrow        Next PROMPT
               Home           First PROMPT
               End            Last PROMPT
               Leftarrow      Previous PROMPT
               Rightarrow     Next PROMPT
               PgUp           Select PROMPT, returning position
               PgDn           Select PROMPT, returning position
               Return         Select PROMPT, returning position
               Esc            Abort selection, returning zero
               First letter   Select first PROMPT with same first letter,
                              returning position
            ---------------------------------------------------------------

            SET KEY procedures: MENU TOs can be nested within SET
            KEY procedures without clearing the pending PROMPTs (unlike
            GET/READ).  However, if the same memory variable is used for
            nested menus, it retains the previous value unless it is
            declared PRIVATE in the SET KEY procedure.  Therefore, it is
            recommended that a different <memvar> be used for each
            menu.  When you are in a SET KEY procedure, you can access
            the name of the return memory variable using READVAR().
            This is useful as status information or to stuff a new
            PROMPT position into the calling menu.

            Note that a maximum of 32 PROMPTs per menu are allowed.

Library:    CLIPPER.LIB


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

   SET MESSAGE TO 23 CENTER

   @ 6, 10 PROMPT "Add"  MESSAGE "New acct"
   @ 7, 10 PROMPT "Edit" MESSAGE "Change Acct"
   @ 9, 10 PROMPT "Quit" MESSAGE "Return to DOS"

   MENU TO Choice


See Also: @...PROMPT SET MESSAGE SET WRAP ACHOICE()

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