Test for menu line enabled

Command groupFlag affectedReversibleExecute on clientPlatform(s)
MenusYESNONOAll

Syntax

Test for menu line enabled
 
line
 or 
instance-name/line

Description

This command tests whether the specified line of a menu instance is enabled. You specify the menu-instance-name and the method-number of the menu line you want to test. It sets the flag if the specified line of the menu instance is enabled. The flag is cleared if the menu instance is not installed on the menu bar.

This command may still return false if the current user has no access to the menu line or if the line is disabled because there is no current record, even after Enable menu line has been executed.

You can disable or enable menus using Disable menu line and Enable menu line.

Example

# If the menu line 'Large' is enabled then disable it

Install menu
 
mView

Test for menu line enabled
 
mView/Large

If flag true
  
Disable menu line
 
mView/Large

Else
  
Enable menu line
 
mView/Large

End If
 
# Alternatively, you can see if a menu line is enabled

# using notation

If
 
$imenus
.
mView
.
$objs
.
Large
.
$enabled

  
OK message
 
{
Enabled
}

End If