Visual FoxPro

From TheAlmightyGuru
Revision as of 16:33, 13 October 2017 by TheAlmightyGuru (talk | contribs)
Jump to: navigation, search
Visual FoxPro 9.

Visual FoxPro, or VFP, is a programming language and IDE from Microsoft. The primary use of the language is for rapid database application development. The programming syntax is similar to that of Visual BASIC (not VB.NET). The language uses dynamic inferred structural typing. It compiles to pseudo-code which is interpreted by the runtimes.

Visual FoxPro is based off of FoxPro, which was the result of Microsoft buying FoxBase from Fox Software. FoxBase was derived from dBase III.

The last official release of Visual FoxPro was version 9, which was released in 2004 with a final service pack released in 2007. Microsoft officially discontinued support in 2015.

Though I had seen FoxPro icons since my first days with Windows 3, I never knew what FoxPro was. I got my first taste of Visual FoxPro in 1999 because it was the main programming language used by the company I started working for. I was familiar with Visual BASIC, so it was pretty easy for me to pickup the syntax, and I had just developed an Access application for my high school, so I knew enough about databases to secure my job. I've used VFP from version 6 until its final release, version 9.0 SP2.



  • The language has a built-in database creator, editor, and viewer. Though it's not without its problems, it's the best I've ever worked with.
  • It has a full SQL interpreter as well as many additional database features not found even in modern databases, and they're very easy to use.
  • The SQL speed is lightning fast, even to the point of outpacing SQL Server at times since you can shortcut the transaction if you're using a single-user.
  • The IDE uses a wonderful multi-window system so you can easily open and view several different code blocks at the same time, even from the same object, something I wish Visual Studio would adopt.
  • Some of the table field types are quite useful like the currency with 4-digit decimal precision, and the numeric which is based on length of digits rather than bytes.
  • Prior to later versions of Visual BASIC, it had more built-in variable types like datetime and logical.


  • The database format is way out of date and doesn't support any modern formats like Unicode.
  • Numeric variables (and likewise, table fields) are divorced from most other languages. There is no support for unsigned values at all, and there are no primitive types like byte, int, long, etc. Instead, all numbers are treated as either signed double integers or floats, and even then, their type is implied.
  • Functions that affect file names like Copy File don't preserve text case.
  • The UI does a poor job of storing the position of windows and the code block you last viewed.
  • Although VFP is mostly object oriented, it has a lot of legacy commands and functions that are procedural. This lack of standards creates confusion.
  • While text fields longer than 254 characters are possible, they require the use of "memos" which are especially cumbersome to work with.


  • VFP has really poor ActiveX and OLE support, often to the point of crashing the UI.
  • VFP has really poor array support. Arrays must be 2D (to resemble tables). Single dimensional arrays, or three or more dimensional arrays are not possible.


This is a list quirks found in VFP and how to resolve them.

  • The VARTYPE function doesn't work correctly if the expression doesn't exist and if it contains a period, because VFP will assume it is a table. You must use TYPE instead.
  • There is a bug that sometimes occurs when, if you LOCATE into a table with only one record, even if FOUND() returns .T. and the record pointer is on the first record, VFP will return and empty string ("") as the value of a field. This can be resolved by adding additional blank records.