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 - menuitemcount() return the number of prompts in a menu http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 menuitemcount()     Return the number of prompts in a menu
------------------------------------------------------------------------------
 Declaration
   menu.hdr

 Syntax
   func int menuitemcount extern
   param value _MENU pMenu

 Arguments
   pMenu is the pointer to a previously created menu system. If 0, the
         default menu will be used.

 Return
   An int equal to the total number of prompts currently defined in the
   specified menu, or -1 in case an invalid menu pointer 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_menuitemcount
   vardef
      _MENU pMenu
   enddef
   
   clear
   pMenu = menunew()
   
   menupromptnew( pMenu, 5, 5, " 1st prompt ", 1, .t., .t. )
   menupromptnew( pMenu, 6, 5, " 2nd prompt ", 2, .t., .t. )
   menupromptnew( pMenu, 7, 5, " 3rd prompt ", 3, .t., .t. )
   menupromptnew( pMenu, 8, 5, " 4th prompt ", 4, .t., .t. )
   
   ? menuitemcount( pMenu )   // Prints 4
   
   menuclear( pMenu )
   
   endproc

   proc main
   Test_menuitemcount()
   endproc

See Also: menupromptnew()

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