Paint a menu item and define a message

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


     <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.


     @...PROMPT is the display portion of the 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.


     .  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

        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.

        @ 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
        RETURN ""               // Character string must be returned

 Files   Library is CLIPPER.LIB.



7 responses to “C5_@…PROMPT

  1. Pingback: C5 UI – Menu System | Viva Clipper !

  2. Pingback: C5_SET WRAP | Viva Clipper !

  3. Pingback: C5_SET MEMOBLOCK | Viva Clipper !

  4. Pingback: C5_SET INTENSITY | Viva Clipper !

  5. Pingback: C5_MENU TO | Viva Clipper !

  6. Pingback: C5 User Interface | Viva Clipper !

  7. Pingback: C5 Commands | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.