Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help With First Menu
Message
From
31/10/2006 10:07:35
 
 
To
31/10/2006 09:07:10
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01165460
Message ID:
01165771
Views:
13
>>I'm trying to set up my first menu, but I'm obviously doing something wrong.
>>I used the Menu Designer and then generated the menu giving me an MPR.
>>I wasn't sure where to insert the code "do menuname.mpr". I've tried it in the main program's code both before and after the "do form" statement. I've tried it in the form's INIT. In all cases, nothing happens. It's always something ridiculously simple, but I am at a loss. For a while I was getting an error message when I'd run the program... something about a missing parameter in the menu's generated code.
>>Please help,
>>Rich Murillo
>
>Rich, based on the following suppositions:
>1. You are developing this menu as part of a project which among other project files contains a prg file which is your main file.
>2. You created and "generated" the menu and it is a part of your project (i.e.: you can see it in the project's hierarchy).
>3. You have a menu selection which (in a non oop mode) is a "command" which reads [do form ("nameofform")] without the outside brackets.
>
>Perhaps your project does not "know" where the MPR is located. During development, the path settings should be established as one of the first things your main program (or other tool you may use to set the paths where the files needed by your application are located). After the paths are set, then you can call specific code like your program or your whatever code you use to call the generated menu.mpr. Of course the READ EVENTS expression should be placed in the line that follows the call to the menu, since it is what enable interaction with the user, and presumably the use will access the forms by selecting it from the menu, right?
>
>Sorry if this is too detailed, but I hope it is helpful.
>
>Hi Pablo:
>I'm really grateful for your reply. No, it was not too detailed. That's the only way to get to the bottom of a problem. All your suppositions were correct. I believe I have done everything as you stated above, however the menu still does not appear.
>I'm a bit unclear as to what you meant by number 3 ("3. You have a menu selection which (in a non oop mode) is a "command" which reads [do form ("nameofform")] without the outside brackets.). I don't have any menu pad that does a "do form". My main program does a "do form xxx". This is followed by a "do menuname.mpr", and then by a "READ EVENTS".
>I know my mistake is probably incredibly simple (probably stupid), but being relatively new to VFP, almost everything is a mystery.
>Rich Murillo

Rich, not a problem, but please know that my level of knowledge is fairly low; since Tracy remains with you, you will resolve this in no time.

This may clarify some of what I mentioned.
The form that I refer to is called from a menu choice which is where the command do form ... is located. In other words I run the form from the menu, and I run the menu from the main program. The READ EVENTS statement appears in the MAIN program, immediately after the statement that calls the menu to run. Oh, and don't forget to insert a CLEAR EVENTS statement on a line just before the line that exits or quits your application.

All the best to you.
=========================
PabloSr, Still Learning!
DevDBFox
Previous
Reply
Map
View

Click here to load this message in the networking platform