Skip to main content
Version: Next

Count menu items

Count menu items ( menu {; process} ) : Integer

ParameterTypeDescription
menuInteger, TextMenu number or Menu reference
processIntegerProcess reference number
Function resultIntegerNumber of menu items in the menu

This command is not thread-safe, it cannot be used in preemptive code.

Description

The Count menu items command returns the number of menu items present in the menu whose number or reference is passed in menu.

If you omit the process parameter, Count menu items applies to the menu bar for the current process. Otherwise, Count menu items applies to the menu bar for the process whose reference number is passed in process.

Note: If you pass a MenuRef parameter in menu, the process parameter serves no purpose and will be ignored.

See also

Count menus