VFP 8


There are a number of deep and useful enhancements to Visual FoxPro such as the improved error handler, the BindEvent function, and the CursorAdaptor class but these notes are just the results of a few hours' experimenting with the Beta release. From what I've seen so far, I like it.

Browse Window

Two small but welcome additions to the Browse Window that make the user interface a little more like what we are used to in similar situations in Access and Excel:

  • CTRL+HOME and CTRL+END now behave just as they do in every other Microsoft application - they take you to the top and bottom of the browse window.
  • Double-click in the header on the border between two columns and the column will autosize to the width needed by the longest field. You can get this behaviour in a grid as well by using AllowAutoColumnFit and AutoFit.

Code Window

The View Definition and Look Up Reference commands are going to be really useful. Both are on the Tools menu and on the shortcut menu for any code editor window:

View Definition

This is similar to the Definition option in Access. If the cursor is on a user-defined procedure or function then this will open a code window showing the definition of that routine. If there is more than one possible definition, for example if you have alternate versions of the same routine in two different procedure files, then a Goto Definition window appears so that you can choose.

Look Up Reference

This is the inverse of View Definition and shows you where a function or variable has been used in the project. It is similar to the XRef report in the Documenting Wizard but it's interactive.

The two of these form a powerful combination for maintenance work. I am extending somebody else's (undocumented) project and have had to be very careful of making changes that have unwanted side-effects. Using View Definition in VFP 8 I can quickly find the source code of an unknown routine and then Look Up Reference shows me where else this routine is being used.

Data handling

The most useful enhancements here are:

  • A new AutoInc field type that automatically increments to give us unique ID numbers. The good news is that we have control over the starting value and can change an existing integer field into an incrementing one. The bad news is that a table having this new type of field can't be opened in VFP 7.
  • SQL UNIONs are now easier because VFP 8 does some type conversion for you. For example, a union of an INTEGER field with a REAL would fail in VFP 7 with the error message: 'SELECTs are not UNION compatible'. VFP 8 will do an implicit conversion and generate an output set of REAL. Similarly with strings of differing lengths.
  • We can now export 65,000 rows to an Excel spreadsheet rather than the old limit of around 16,000.

Puzzle

Younger readers may not remember that early versions of FoxPro included a puzzle. It used to be the last entry on the Help menu in Fox 2.5 and 2.6 but disappeared from the menu when Visual FoxPro came out.

For a while it was still available from the Command Window but in VFP 6 it vanished altogether. It's back in VFP 8 as:

ACTIVATE WINDOW puzzle
[Puzzle]
The aim of the game is to rearrange the blocks into numerical order. Click on any one of the blocks around the space to slide that block into the space. You can also slide a row or column of blocks by clicking on the block at the other end - click on 11 or 15 here to move the whole vertical or horizontal row of blocks.

Press CTRL-END to cheat.

Nice to see an old friend back but one has to wonder at the commercial justification.

Hints & tips

The textbox class in Visual FoxPro 9 has a new Autocomplete property which shows the user the previous values that have been entered in that textbox.
Autocomplete in VFP 9

Your Access database will look more impressive if you add custom toolbars...
Custom toolbars

FoxPro has always had functions to read and write files at a low level...
Foxpro low level file functions

More...
More pages of hints and tips for users of Microsoft FoxPro and Access databases.

Site Map