5

The LA Fox Developer Newsletter
June 1999
Palm Springs DevCon Report
The Keynote for DevCon was highlighted with a demo of the
next version of Visual FoxPro. There is no release date. Here’s
a summary of some of what was shown:
- Code name is Sedona
- Flat toolbars (like Word, Excel)
- Command, Data Session, and other windows are dockable and can dock to each other. Randy Brown showed how the
Command and Data Session windows can be docked together.
- The debugger windows can be docked into a page-frame like
Window with tabs at the bottom
- The editor now has a bar on the left-hand side. Just click on
the bar and set a break point on that line of code
- Set bookmarks in the editor
Highlight a word in the editor, then press a hotkey to find the
next instance of the word
- View whitespace (you can see where spaces, tabs, and
paragraphs are at) in the editor
- Hyperlinks in comments
- Modified file indicator in the title bar for the window
- Many of the features of the COB editor extensions have been
included, including change case, command completion, etc.
This is configurable.
- To edit a page on a page frame, you don’t have to right-click
and select Edit. There is a keypress to do this now.
- Close parenthesis. You don’t need to count the number of
parns needed to close a statement. Visual FoxPro will tell you
how many you need.
- Timeout added parameter added to MESSAGEBOX

And the biggest thing.. .that got a huge cheer•

lntellisense, but done better. For example, you can type USE and a list of the most recently used tables is diaplayed, or a list of the tables in the DBC. It will also read the type libraries of other objects and work with them too.

Also, forgot to mention:

Robert Green of MS said there will be no VFP6.5. The latest Visual Studio SP3 not only fixes many bugs, including C0000005 and printer driver bugs, but also sneaks in a good number of new features (which most of you should already know about) which is really a no-no in a Service Pack. I guess technically speaking these new features could have made 6.0 into a 6.1, but they like to use the Service Pack mode at MS now.


Craig Berntson
Microsoft FoxPro MVP
Salt Lake City Fox User Group
How to Avoid the “Cannot Quit
Visual FoxPro” Message
Ever tried to close your application, only to be told you can’t? Here’s the story.

You’ve developed your application and handed itto the user. Everything is fine. Then you get a phone call. The user tried to close the app, but all that happened was that a message appeared: “Cannot quit Visual FoxPro” (see Figure 1). Why? Because the application is still in an event loop.


Figure 1: The dreaded Cannot Quit message

Somewhere in the app’s controlling logic, you have code that looks like this:

DO MainMenu.MPR
READ EVENTS

Once the program has been put in an event loop (which is what READ EVENTS does), you won’t be able to close down until you have exited the event loop. You do that with the CLEAR EVENTS command. You would normally execute CLEAR EVENTS whenever the user signals that they want to close the application in the Exit command from the File menu, for example.

But what if the user tries to close the application by clicking on the Close box in the title bar? Or by shutting down Windows itself while the application is still running? In those cases, the program won’t have had an opportunity to execute CLEAR EVENT. The event loop is still active, so the Cannot Quit message appears.

To avoid this, use the ON SHUTDOWN command. This works in the same way as VFP’s other “On” commands, such as ON ERROR, in that it specifies an action which is to be taken when a certain event occurs. In this case, the event is any attempt to close the application, by whatever means.

So all you have to do is execute ON SHUTDOWN CLEAR EVENTS. You do this near the beginning of the program in any case before the READ EVENTS. Once you have done that, the user should never again see the Cannot Quit message. When the user hits the Close box in the title bar, the program will execute the ON SHUTDOWN code, which in turn will exit
(Con’t, page 4)
Page 5

5