[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 @...PROMPT
 Paint a menu item and define a message
------------------------------------------------------------------------------
 Syntax

     @ <nRow>, <nCol> PROMPT <cMenuItem>
        [MESSAGE <cExpression>]

 Arguments

     <nRow> and <nCol> are the row and column coordinates of the menu
     item display.  Row values can range from zero to MAXROW(), and column
     values can range from zero to MAXCOL().

     PROMPT <cMenuItem> is the menu item string to display.

     MESSAGE <cExpression> defines the message to display each time the
     current menu item is highlighted.  A code block evaluating to a
     character expression may optionally be used.

 Description

     @...PROMPT is the display portion of the CA-Clipper lightbar menu
     system.  Each @...PROMPT command paints a menu item in the current
     standard color and defines an associated MESSAGE to be displayed on the
     line specified by SET MESSAGE.  The lightbar menu is then invoked with
     MENU TO.  You can specify menu items in any order and configuration of
     row and column position.  MENU TO, however, navigates the current list
     of menu items in the order they were defined. You can define up to 4096
     menu items for each menu.

     After each @...PROMPT command, the cursor is located one column position
     to the right of the last menu item character and ROW() and COL() are
     updated to reflect the new cursor position.  This lets you use ROW() and
     COL() to specify consecutive menu item positions relative to the first
     one painted.  See the example below.

 Examples

     .  This example displays a lightbar menu with the associated
        messages displayed on the next line.  When the user presses Return,
        the position of the item in the list of menu items is assigned to
        nChoice:

        LOCAL nChoice := 1
        SET WRAP ON
        SET MESSAGE TO 2
        @ 1, 3 PROMPT "File" MESSAGE "Access data files"
        @ ROW(), COL() + 2 PROMPT "Edit" ;
           MESSAGE "Edit current record"
        MENU TO nChoice

     .  This example shows how to pass the MESSAGE clause a code block
        which calls a user-defined function that displays a message in a
        different color:

        SET COLOR TO gr+/b,r+/n
        SET MESSAGE TO 23    // This is necessary.
        CLEAR SCREEN

        @ 3,4 PROMPT "one "  MESSAGE {||UDF("Message One  ")}
        @ 4,4 PROMPT "two "  MESSAGE {||UDF("Message Two  ")}
        @ 5,4 PROMPT "three" MESSAGE {||UDF("Message Three")}

        MENU TO test

        FUNCTION UDF(cParm)
        cOldColor := SETCOLOR("w+/n")
        @ 22,1 SAY cParm        // Must be different row than the
                                // SET MESSAGE TO nRow
        SETCOLOR(cOldColor)
        RETURN ""               // Character string must be returned

 Files   Library is CLIPPER.LIB.


See Also: ACHOICE() MENU TO SET MESSAGE SET WRAP* SETCOLOR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson