Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menus in VFP9

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I am learning about menus in VFP9. I can create a menu and run it to invoke a screen. Have noticed several things.

1. If I am creating or modifying a menu, then when I wish to make it available for use, I click on Menu | Generate. This the creates a file MyMenu.mpr so that I can then key in DO Mymenu.mpr. That works fine. If I subsequently modify the menu, generate it again, that appears to work OK, giving me the mymenu.mpr file with a new datestamp.

But when I again key in DO mymenu.mpr, I am getting the original unmodified menu displayed. The only way I have found round this (by trial and error) is to delete the file called MyMenu.mpx before generating the menu. If I do that the modified menu is correctly displayed. Why is this, and is there a way round this feature?

2. When I display my menu, it always gets a Format option tacked on whenever the cursor is in the command window. Why is this?

3. What is the best way of exiting from a menu? I have tried including an Exit selection, with associated command RETURN, but that has the effect of exiting from my VFP session, which I do not want (Although that would perhaps be fine if I was running the menu outside of the VFP development environment.

Thanks. Andrew M.
 
Andrew,

I'll try to give you the answers:

1. This shouldn't happen. It looks like VFP is not correctly comparing the dates of the MPR and the MPX. Is it possible you have SET DEVELOPMENT OFF (which should nornally never be the case)?

2. This has got nothing to do with menus. The Format menu is present because your command window is active. When you incorporate your menu in an application, the command window won't be present, and the Format menu won't appear.

3. To get rid of your menu in the development environment, and to restore the VFP menu, use SET SYSMENU TO DEFAULT. When you use the menu in an application, the Exit command (or whatever) on your menu should lead to a CLEAR EVENTS (assuming you have a READ EVENTS in your main program, which you will need in order for the menu to work properly).

If any of the above is not clear, come back.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks very much Mike. That does the trick. I did indeed have development set OFF, but have gone into Tools | Options | General to fix that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top