Menu.AddItem
The Menu.AddItem function allows a script to add an option to a context sensitive menu.
Syntax |
Menu.AddItem(Text) |
Description |
Adds an option to the menu. Each option on the menu has an Index Number. The Index Numbers of a menu and its submenus are numbered from top to bottom, with the next number in the sequence allocated to the next selectable option, irrespective of whether it is on a menu or on a submenu. |
Arguments |
Text {string} The text that is shown for the option in the menu. |
Returns |
String |
Example:
Menu.AddItem("Set Value for Point A1")
Where:
- "Set Value for Point A1" is the name of the option as shown on the menu.
The Add.Item function creates the option in the menu, but does not define the functionality of that option (which has to be defined after the Menu.Display function, using other functions such as the Server Functions).