Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FreshWin (c) Fresh Technologies - <b>@...prompt pseudo-function</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  @...PROMPT                                                  Pseudo-Function
 Purpose..: Replace the Clipper @...PROMPT command
-------------------------------------------------------------------------------
 Syntax...: @ <nX>, <nY> PROMPT <cPrompt>        ;
                         [COLOR <cPromptClr>]    ;
                         [MESSAGE <cMsg>]        ;
                         [MSGCOLOR <cMsgClr>]    ;
                         [MSGROW <nMsgX>]        ;
                         [MSGCOL <nMsgY>]        ;
                         [HOTKEY <nHotKPos>]     ;
                         [HOTCOLOR <nHotKClr>]   ;
                         [BOXED WITH <uBox>]     ;
                         [EXECUTE <bBlock>]      ;
                         [SHADOWED <lShad>]

 Arguments: <nX>            = row to place the menu prompt.
            <nY>            = column to place the menu prompt.
            <cPrompt>       = menu item string to display.
            [<cPromptClr>]  = color string to use for the menu item.

            [<cMsg>]        = the menu prompt message to display.
            [<cMsgClr>]     = color to use for the message.
            [<nMsgX>]       = row to display message.
            [<nMsgY>]       = column to start message.

            [<nHotKPos>]    = position in menu string for hot key.
            [<cHotKClr>]    = color to use for the hot key character.

            [<uBox>]        = parameter that can take a predefined
                              frame type or a custom frame type. To use
                              a custom frame type, see the guide options
                              titled:
                                  Reference -> Creating Custom Frames.
                              The table below lists the pre-defined
                              frame types.

            Frame Type Manifest Constants as found in FW_BOX.CH
            --------------------------------------------------
            Value  FW_BOX.CH    Description
            --------------------------------------------------
             1     B_SSSS       single line box
             2     B_DDDD       double line box
             3     B_SDSD       NS-single EW-double
             4     B_DSDS       NS-double EW-single
             5     B_SSDD       NE-single SW-double
             6     B_SDDS       NW-double SE-single
             7     B_DSSD       NW-double SE-single
             8     B_DDSS       NE-double SW-single
             9     B_THICK      thick solid
            10     B_LIGHT      shaded light
            11     B_MEDIUM     shaded medium
            12     B_HEAVY      shaded heavy
            13     B_NONE       spaces - DEFAULT
            --------------------------------------------------

            [<bBlock>]      = code block to execute when
                              the menu item is chosen.

            [<lShad>]      = logical which can be used
                             to shadow the prompt or, if you
                             us BOXED WITH, the prompt box. It
                             will draw a half shadow only.

 Returns..: NIL

 Remark...: The command, @...PROMPT, can be used in a manner
            similar to the @...PROMPT command which is the display
            portion of the Clipper light-bar menu system.  Each
            command paints a menu item in your choice of colors,
            defines an associated message to be displayed wherever you
            want in a user-defined color, allows you to define a hot
            key in your choice of colors, frame it with a defined set
            of boxes or your own and lets you execute a code block
            if the option is picked. Wheww! Then the light-bar menu
            is invoked with the use of the command, MENU TO.
            Menu items can be specified 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.
            As you know, up to 32 menu items can be defined for each menu.

            You must have a #include "FW_MENU.CH" statement in your
            source code file to use the command.

            In addition to using the arrow keys, the Tab key
            is active for moving about the menu.

            The command can be used with a mouse.

 Source...: FW_MENU.CH
-------------------------------------------------------------------------------
 Example..: . The example displays a portion of a program
              which contains the following menu.

      while !empty( nCho )

         @ 4, 14 PROMPT   " Bond interest            ";
                 COLOR    "+W/B,+W/BG"                ;
                 MESSAGE  "Excludes bearer bonds    " ;
                 MSGROW   24                          ;
                 MSGCOL   5                           ;
                 MSGCOLOR "+W/B"                      ;
                 HOTKEY   2                           ;
                 HOTCOLOR "+GR/B"                     ;
                 EXECUTE  { || BondInt() }            ;
                 BOXED WITH B_SSSS

         @ 8, 14 PROMPT   " banK interest            ";
                 COLOR    "+W/B,+W/BG"                ;
                 MESSAGE  "Includes savings & loans " ;
                 MSGROW   24                          ;
                 MSGCOL   5                           ;
                 MSGCOLOR "+W/B"                      ;
                 HOTKEY   5                           ;
                 HOTCOLOR "+GR/B"                     ;
                 EXECUTE  { || BankInt() }            ;
                 BOXED WITH  B_SSSS

         @ 4, 14 PROMPT   " Mortgage interest        ";
                 COLOR    "+W/B,+W/BG"                ;
                 MESSAGE  "Only those not in default" ;
                 MSGROW   24                          ;
                 MSGCOL   5                           ;
                 MSGCOLOR "+W/B"                      ;
                 HOTKEY   2                           ;
                 HOTCOLOR "+GR/B"                     ;
                 EXECUTE  { || MortInt() }            ;
                 BOXED WITH B_SSSS

         @ 8, 45 PROMPT   " Trust income             ";
                 COLOR    "+W/B,+W/BG"                ;
                 MESSAGE  "Includes only that for T3" ;
                 MSGROW   24                          ;
                 MSGCOL   5                           ;
                 MSGCOLOR "+W/B"                      ;
                 HOTKEY   2                           ;
                 HOTCOLOR "+GR/B"                     ;
                 EXECUTE { || TrustInc() }            ;
                 BOXED WITH B_SSSS

         MENU TO nCho

      enddo

 Note.....: When using HOTKEY, the command counts positions
            starting from one. Pressing the hot key moves
            the cursor to the item and executes it.

            When using BOXED WITH, each item is boxed so leave
            enough space between the prompt items.

            The above code generates a screen that looks like:

          +--------------------------+   +--------------------------+
          | Bond interest            |   | Trust income             |
          +--------------------------+   +--------------------------+

          +--------------------------+   +--------------------------+
          | banK interest            |   | Mortgage interest        |
          +--------------------------+   +--------------------------+


           Excludes bearer bonds

See Also: MENU TO

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