User Tools

Site Tools


jvs:cigal:manual:chapter3:menuitem

CIGAL Reference Manual, Chapter 3 (Functions): menuitem

usage: result = menuitem(menuspec,item,flag)

MENUITEM is used to get information about menus in the menu file (see MENUFILE(4)). It is most useful when used within a menu, so that one menu entry can have access to other menu entries, or within a macro designed to extract menu help information. It can also be used interactively, however, as a way of finding out about the contents of a menu, but for this the SHOW MENU command is probably more useful (see SHOW(2)).

If MENUITEM is called with no arguments, or if the MENUSPEC argument is 0, the function returns the total number of menus stored in the menu file.

The MENUSPEC argument specifies which menu to look up:

   If MENUSPEC is a name, that name is searched in the menu file table.

   If MENUSPEC is a number > 0, the menu that is currently active in position
    MENUSPEC (1-13, see [MENUS][1] or [MENU][2]) is used.

   If MENUSPEC is a number < 0, the menu in position -MENUSPEC in the menu
    file is used.

The ITEM argument indicates what information about the menu to return:

    If ITEM is omitted, or less than -1, the function returns the total number
     of items in the specified menu.

    If ITEM is -1, the returned value is a character string containing the
     name of the specified menu.

    If ITEM is >= 0, the returned value is a character string containing the
     ITEMth entry in the specified menu.

If the FLAG argument is specified and non-zero, the function returns no value.

 Instead: 
          if FLAG is > 0, and the ITEM argument is >= 0, then the ITEMth entry
              in the specified menu is executed.
          
          if FLAG is < 0, and the ITEM argument is > 1, and the specified menu
              is a SCREEN or TEMP menu, then the ITEMth entry is highlighted
              by reversing the display attributes (reverse video).

See Also:
EXEC(2), MENU(2), MENUFILE(4), MENUS(1), SHOW(2)

CIGAL Home, CIGAL Manual, Functions List, Manual Help

jvs/cigal/manual/chapter3/menuitem.txt · Last modified: 2023/02/23 18:43 (external edit)