Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Fast Library For Clipper 3.02 Reference - <b>dispmenu()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DispMenu()

         Actives a menu that has been previously created

    Syntax:

         DispMenu( aMenu [, nInit] ) -> nOption

         aMenu : An array with all the structure of the menu that has
                 been created previously with NewMenu().
         nInit : An optional numeric value indicates the item that has
                 to be ejecuted at the menu start.

    Description:

         Actives a menu and control all the navegation keys living back
         a value in the next way:

         nValue := ( Menu_Num * 10000 ) + ( Opt_Num * 100 ) + SubMenu Option

         It is to observe that lots of menues can be created and later
         active the necesary, this can be very useful for multilenguages
         programs in the ones the user select the language.

         The associate messages to each item will be shown where the clause
         of set Messages indicates.

    Return:

         A numerical value indicating the selected option or 0 if Esc is
         pressed.

    Example:

         aMenu := NewMenu( { "^System", "^Tools", "^Other" }, ;
                           { "N/W", "R/W", "W/B",  "W+/B", ;
                             "N/W", "W/B", "N+/W", "R/W", "GR+/B" } )

         AddItem ( aMenu, 1, "Item ^1-1", "Message" )
         AddItem ( aMenu, 1, "Item ^2-1", "Message" )
         AddItem ( aMenu, 2, "Item ^1-2", "Message" )
         AddItem ( aMenu, 2, "Item ^2-2", "Message" )
         AddItem ( aMenu, 3, "Item ^1-3", "Message" )

         nOpt := DispMenu ( aMenu, 3 )

         Do Case
           Case nOpt == 101             // Menu 1, option 1
             ...
           Case nOpt == 102             // Menu 1, option 2
             ...
         EndCase

See Also: NewMenu()

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