**CIGAL Reference Manual, Chapter 3 (Functions): menuitem** ===== Menuitem -- Get information about menu commands ===== ** usage: result = menuitem(menuspec,item,flag)** MENUITEM is used to get information about menus in the menu file (see [[jvs:cigal:manual:chapter4:menufile|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 [[jvs:cigal:manual:chapter2:show|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:**\\ [[jvs:cigal:manual:chapter2:exec|EXEC(2)]], [[jvs:cigal:manual:chapter2:menu|MENU(2)]], [[jvs:cigal:manual:chapter4:menufile|MENUFILE(4)]], [[jvs:cigal:manual:chapter1:menus|MENUS(1)]], [[jvs:cigal:manual:chapter2:show|SHOW(2)]] [[jvs:cigal|CIGAL Home]], [[jvs:cigal:manual|CIGAL Manual]], [[jvs:cigal:manual:chapter3|Functions List]], [[jvs:cigal:manual:help|Manual Help]]