SHOW WINDOW

Bar(), Menu(), Pad(), Popup(), Prompt()

These functions tell you about your most recent menu choice. The first four indicate which bar, menu, pad or popup you picked. PROMPT() returns the text for the chosen item. POPUP() can also tell you if a particular popup has been defined.

Usage

nChosenBar = BAR() cChosenMenu = MENU() cChosenPad = PAD() cChosenPopup = POPUP() lPopupExists = POPUP( PopupName ) cChosenPrompt = PROMPT()
The timing for retrieving these items can be tricky. Your best bet is to pass them to the processing routine you set up with ON SELECTION, so you're sure you get the right value.

These functions are set only when there are ON SELECTION commands for the items in question. For an item with no action set or with just an ON command, these functions don't change.

For an interesting exercise in what changes when, add some pads with ON EXIT conditions at various levels to the system menu. Put the five functions here in the Debug window and make some choices. Watch when the various functions have values and when they're empty. Putting WAIT WINDOWs in the ON EXIT conditions makes it particularly easy to see what's going on. As FoxPro works its way down to the chosen item, the status functions reflect the level currently being processed.

Example

ON SELECTION POPUP MyPop ;    DO ProcessPopup WITH POPUP(), BAR(), PROMPT()

See Also

Define Bar, Define Menu, Define Pad, Define Popup, Menus, On Exit Bar, On Exit Menu, On Exit Pad, On Exit Popup, On Selection Bar, On Selection Menu, On Selection Pad, On Selection Popup


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net