Converting from FoxPro 2 to VFP

Although Visual FoxPro is very compatible with earlier versions of FoxPro and all versions of FoxPro can share data file, there are some minor programming problems when you convert an application from something like FoxPro for Windows or DOS into Visual FoxPro. Much of the code can be transported straight from one language to the other but the disadvantage with this sort of conversion is that it leaves you with a system which relies on outmoded features.

The immediate effect is not too serious. Your application will look very dated but the users will be used to that and the familiarity may even be an advantage. More serious problems arise in the longer term because you will find it difficult to take full advantage of the new features of the VFP family.

Compatibility across the FoxPro generations though is very good. As an extreme example, this is part of a screen shot showing a FoxBase program we wrote in 1990. The original source files are running under VFP 9 having had no changes made to them at all. The original program is running simultaneously under DOS in the Windows XP console and the two are sharing the same data files.

[FoxBase application in Visual FoxPro 9]

The FoxBase system is set of program (.prg) files and could be compiled into a VFP executable and distributed to the users. That solves the immediate problem but the application is at a dead end in terms of any future development. If you have to convert a similar system then the best tactic might be to rewrite it. This will take some effort but the good news is that the basic programming language has not changed and you will be able to reuse much of the logic in functions and procedures. What's more, you do not have to do it all at once. Visual FoxPro can read and write data to tables in FoxPro 2.00 format and the two versions respect each others' record locks.

The links below discuss six stages of the conversion:


Introduction | Data | Program code | Menus | Reports | Screens | Strategy