CNTBAR( ) Function

Example   See Also

Returns the number of menu items on a user-defined menu or the Visual FoxPro system menu.

Syntax

CNTBAR(cMenuName)

Returns

Numeric

Arguments

cMenuName

Specifies the name of the menu for which CNTBAR( ) returns the number of menu items. For a list of the Visual FoxPro system menu names, see the System Menu Names topic.

Remarks

If a user-defined menu is created with the PROMPT option in DEFINE POPUP, Visual FoxPro evaluates the number of menu items when you issue ACTIVATE POPUP. For such a menu, CNTBAR( ) returns a meaningful value only after you activate the menu. However, if the menu items in the menu are created with DEFINE BAR, CNTBAR( ) can determine the number of menu items before you issue ACTIVATE POPUP.