FoxPro hints and tips

These tips might help avoid common problems in 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 - usually to the non- existent record at EOF.
  3. Dock your form design 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 database 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.