FoxPro Tips


These tips apply to all versions of Visual FoxPro:

  1. Don't use PUBLIC variables. Make them PRIVATE in a top-level program instead. They'll behave like PUBLICs at run-time but will be cleared at the end of a program run at design time.
  2. Remember that commands like COUNT move the record pointer.
  3. Put your form toolbars at the side of the screen. Leaving them at the top gives a design area shaped like a letter box - less useful than a squarer shape.
  4. If you click on the 'Index' column in the Table Designer then the index will have the same name as the field - BUT it will be truncated to 10 characters.
  5. Add a Copyright method to your forms and classes and use it to store a copyright notice and history of changes.
  6. Save time - type CD instead of SET DEFAULT TO
  7. Use Tools|Options|Syntax Coloring to make comments appear bold or italic. This makes them easier to spot on a monochrome printout.
  8. Remember that a 640 x 480 pixel form won't fit on a 640 x 480 screen. You've got to leave room for the Windows status bar and for things like the Office shortcut bar. 400 pixels is a safe height.
  9. Many design rules were formed when disk space was expensive. Don't be afraid to waste a byte or two.
  10. You can add Word and Excel documents to the Project Manager under the Other files tab. Double-click to open your project spec, bug list, or any other useful file.

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