[<<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 Number * 100 ) + Option Number

         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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson