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 - menugetpromptlen() return the length of a prompt's text http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 menugetpromptlen()  Return the length of a prompt's text
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   func uint menugetpromptlen extern
   param value _MENU pMenu, ;
         value int   iId

 Arguments
   pMenu is the pointer to a previously created menu system. If 0, the
         default menu will be used.
   iId   is the id number of the prompt.

 Return
   The length of the text (caption) of the specified prompt, excluding the
   hot key marker (&), or 0 in case an invalid menu pointer or id was passed.

 Description
   This is a utility function that might be called from within menu handlers.

 Example
   #define EXAMPLE_MENU
   #include example.hdr

   proc Test_menugetpromptlen
   vardef
      _MENU pMenu
   enddef
   
   clear
   
   menusethot( .t. )
   pMenu := menunew()
   
   menupromptnew( pMenu, 2, 10, " Op&tion 1 ", 1, .t., .t. )
   menupromptnew( pMenu, 3, 10, " Option &2 ", 2, .t., .t. )
   menupromptnew( pMenu, 4, 10, " Option 3 ",  3, .t., .t. )
   menupromptnew( pMenu, 5, 10, " Op&tion 4 ", 4, .t., .t. )
   
   @ 10, 0
   ? menugetpromptlen( pMenu, 1 )  // Prints 10 (hot-key marker ignored)
   ? menugetpromptlen( pMenu, 2 )  // Prints 10 (hot-key marker ignored)
   ? menugetpromptlen( pMenu, 3 )  // Prints 10
   ? menugetpromptlen( pMenu, 4 )  // Prints 10 (hot-key marker ignored)
   
   menuclear( pMenu )
   
   endproc

   proc main
   Test_menugetpromptlen()
   endproc

See Also: menugetprompt()

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