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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keyboard Shortcut to Save without Exiting

Status
Not open for further replies.

Brak

Programmer
Jul 11, 2001
158
US
According the the help file in the Mac version, one has a keyboard shortcut to exit and save by pressing what ever that special mac key is called with W, or to just save by pressing that "mac key" with S.

However in the Win version pressing CTRL+W exits and saves, but CTRL+S doesn't!!!
Having a keyboard shortcut to save without exiting would be extremely helpful in debugging. Its a pain to have to constantly either reopen the file or use the menu to save without exiting.

Does anyone know how to save without exiting via a keyboard shortcut. I can't understand why they wouldn't include this, and the fact they do include it for the Mac and not Win makes no sense at all!

Any help/input/explanation on this topic would be greatly appreciated.
 
Have you tried using the ON KEY command?

As long as your Save routine is separated (or a separate version exists without an Exit) you should be able to execute that separate code when the key combination is used.

Look in your FP Help for information on how to use ON KEY
Also a Google search for foxpro "on key" will also turn up a number of references

Good Luck,
JRB-Bldr

 
CTRL+S does save without closing in the VFP IDE. If it's not working for you, perhaps you've overridden that key somehow.

Tamar
 
I have this
define bar _MFI_SAVE of _MFILE prompt '\<Save' key 'ctrl+s','^S'
in my Foxstart.PRG for this purpose. :)

Tomas
 
Yep, it comes from the system menu (as do most of VFP's hotkeys). You don't actually have to have the menu bar visible. Just the DEFINE BAR, as shown by Tomas, will do. Of course, every time you reset your environment you should put this back too.

In the Mac version, I always had a setup.prg that included this one as well as creating menu definitions to add shortcuts for the (missing) home/end/pgup/pgdn keys on Macbooks.
 
Thanks Tomas for that solution.

Is there a way to have it executed whenever I start FP without having to put it in all my programs. Is there an "autoexec" type file one can place in the FP directory which can contain this line? Or a way to put something into the CONFIG.FPW file to trigger it?
 
Ah...... nevermind - the FoxStart.prg is the autoexec, I just has to rename foxstart.app to foxstart.app.tmp
 
Is there a way to have it executed whenever I start FP without having to put it in all my programs. Is there an "autoexec" type file one can place in the FP directory which can contain this line? Or a way to put something into the CONFIG.FPW file to trigger it?

There are several options.

In config.fpw:

COMMAND = <any command you want>
- or -
ASSIST = <your startup prg>

Or you can use the command line, and the command line can include the -c switch to point to a specific config.fpw.

There's a real witches' brew of options here.

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top