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