Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a shortcut menu
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00549942
Message ID:
00549960
Views:
24
>I mean if I have a shortcut menu and I want one of the options to return a .t. is something happened successfully, can I do that?

Nor really "return", but you declare the variable before calling the menu (or use an object property to store the result value) and check it after the menu call.
* mymenu1.mpr
DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF shortcut PROMPT "Success"
DEFINE BAR 2 OF shortcut PROMPT "Bummer"
ON SELECTION BAR 1 OF shortcut myvariable = .t.
ON SELECTION BAR 2 OF shortcut myvariable =.f.

ACTIVATE POPUP shortcut
* Form.RightClick()
myvariable = .f.
do menu1.mpr
WAIT WINDOW IIF (!empty(myvariable),  "Success!", "Bummer...")
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform