Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - selectprompt() reposition the prompt highlight bar http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 selectprompt()      Reposition the prompt highlight bar
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   proc selectprompt extern
   param       int  iMenuId, ;
         value uint uKey

 Arguments
   iMenuId is a prompt identifier.
   uKey is a match character.

 Return
   None.

 Description
   The selectprompt() procedure allows a program to move the current prompt
   highlight pad represented by iMenuId to the menu prompt whose first
   character matches uKey. The uKey parameter expects the ASCII value
   of the first character of the prompt.

   Use selectprompt() to force a menu selection or to program accelerator
   keys when using menu to return.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   /*
   When using menu to return, you can program menus where the user is to
   press the uppercase letter, not necessarily the 1st letter in the
   prompt. For example, if the menu is: "Edit     Change     eXit" the
   selectprompt() function can be used to program the "ECX" keys.
   */
   
   proc Test_selectprompt
   vardef
      int  iChoice
      uint uKey
   enddef
   clear
   @ 1, 5 prompt "Edit"
   @ 2, 5 prompt "Change"
   @ 3, 5 prompt "eXit"
   do while .t.
      menu to iChoice return
      uKey := lastkey()
      if chr( uKey ) $ "EeCcXx"
         selectprompt( iChoice, uKey )
      endif
   enddo
   @ 5, 0 ?? iChoice
   endproc

   proc main
   Test_selectprompt()
   endproc

See Also: menu to selectid()

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