[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DispMenu()

         Activates a menu that has been previously created

    Syntax:

         DispMenu( aMenu [, nInit] ) -> nOption

         aMenu : An array defining the structure of the menu that was
                 created previously with NewMenu().
         nInit : An optional numeric value indicating the number of the item
                 to be highlighted when the menu is first displayed

    Description:

         Activates a menu and processes all navigation keys, returning
         a value computed as:

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

         Note that multiple menus can be created and later activated
         as needed; this can be very useful for maintaining menus in
         a variety of languages.

         The associated message text for each item will be displayed on
         the screen row specified by SET MESSAGE TO <nRow>.

    Return:

         A numeric 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