show_menu - hpgDesigns/hpgdesigns-dev.io GitHub Wiki
NOTOC {{-}}
Displays a standard context menu of plain-text items. Items are delimited by the pipe symbol '|'. You can include a horizontal bar separator by using hyphen '-' in place of an item. Returns the index of the selected item, where 0 indicates the first item, def if no item was selected.
- str: A string representing the items to display. See below.
- def: The index of the default item. See Return Values.
The string passed to str must be a list of individual menu items, separated by the pipe symbol ('|'). If a single hyphen is named as a menu item, it will be replaced with a separator. For example, the Example Call shown below will display a menu with four options, with the fourth option separated from the others by a horizontal bar.
When the end user selects an item, show_menu
returns the 0-based
index of the item, excluding separators. When the user clicks away from
or otherwise destroys the menu, the return value is def.
In the Example Call below, show_menu
will return 0, 1, or 2 for the first three items, respectively, or 3 if
the "Exit" item is selected.
show_menu("Item 1|Item 2|Item 3|-|Exit",0);
Category:Function:Obsolete