Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameter in menu???
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00714073
Message ID:
00714132
Views:
15
>I created a menu using the infamous VFP menu designer (VFP7)...making sure to generate it when done. I then changed the mymenu.mpr program to something like this:
>
>LPARAMETERS oCallingObject
>DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
>DEFINE BAR 1 OF shortcut PROMPT "Replicate..."
>ON SELECTION BAR 1 OF shortcut _screen.ActiveForm.preReplicate(oCallingObject)
>ACTIVATE POPUP shortcut
>
>....So here is my problem. This works fine if I'm in VFP, but if I run the .exe, I get an error saying there is no parameter statement. Anyway I fixed the problem by simply making the .mpr a .prg - but this makes me wonder if it's just not possible to pass parameters to menus??? (or in this case a shortcut menu)

Adding to what was already replied, I think you won't need to hand edit the generated mpr files. In the menu designer, select View:General options...:Setup and, in the setup code editor, place
PARAMETERS oCallingObject
(notice PAR... instead of LPAR...). The bars definitions in your menu can reference oCallingObject and you can happily ;-) continue to use the infamous VFP menu designer without the need to hack its generated code.
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform