GETPAD( ) Function

Returns the menu title for a given position on the menu bar.

GETPAD(cMenuBarName, nMenuBarPosition)

Return Values

Character

Parameters

  • cMenuBarName
    Specifies the menu bar name.
  • nMenuBarPosition
    Specifies a position on the menu bar. nMenuPosition can range from 1 (the leftmost menu title on the menu bar) through the number of menu titles on the menu bar.

Remarks

Menu names on a titles bar can be added, removed, or rearranged. Use DEFINE PAD to add a menu name to a title bar or RELEASE PAD to remove a menu title.

Example

The following program uses GETPAD( ) to test if the Edit menu name is on the Visual FoxPro system menu bar. If it is, GETPAD( ) returns the menu name. (To restore the Edit menu bar to its default state, issue the command SET SYSMENU TO DEFAULT.)

FOR gnCount = 1 TO CNTPAD('_msysmenu')      && Number of pads
   IF PRMPAD('_msysmenu', GETPAD('_msysmenu', gnCount)) = 'Edit'
      RELEASE PAD (GETPAD('_msysmenu', gnCount)) OF _msysmenu
      EXIT
   ENDIF
ENDFOR

See Also

DEFINE MENU | DEFINE PAD | RELEASE PAD