Migrating from Visual FoxPro
From Xojo Documentation
Visual FoxPro (VFP) is a Windows programming tool made by Microsoft. It has been given its end-of-life and is no longer supported by Microsoft. VFP has its own tightly integrated database engine, a form designer and a programming language.
Migrating a Visual FoxPro application is typically a three-step process where you migrate the database itself, the forms that are used to manipulate the data and the scripting code.
When migrating a VFP application, you first need to consider the database. You can connect to a VFP database using ODBC on Windows, but it makes more sense to migrate your data to SQLite, which is a fast, cross-platform database.
Your VFP forms are likely used to edit data in tables. You can recreate these forms as Windows (or web pages) using drag and drop just as you can with VFP.
For simple desktop applications, you may find the DataControl control to be an easy way to map your fields to database tables and columns without having to write a lot of code.
VFP is programmed using a proprietary language that is quite similar to the Xojo programming language. You will have to rewrite your code, but at the same time will find the Xojo programming language to be familiar.
Cully Technologies has a tool that can help you migrate your Visual Fox Pro projects to Xojo.
The syntax of the two languages is different, but the concepts are quite similar. For example, to create an instance of a new class in VFP, you might use this code:
LOCAL oMyClass oMyClass = CREATEOBJECT("MyClass")
In Xojo you would write:
The VFP MessageBox command is similar. Instead of writing this:
You would write this:
Here are some other VFP commands and their Xojo equivalents:
|VFP Command||Xojo Command|
|FOR EACH..ENDFOR||For Each...Next|
|DO CASE..END CASE||Select Case|
Special thanks to Kevin Cully of Cully Technologies for assistance with the information in this section.
To learn more about Xojo and how you can use it to replace Microsoft Visual FoxPro, check out these topics:
- Xojo Q&A for FoxPro Developers
- FoxCon 2015: Xojo for Desktop and Web
- Getting Started
- Desktop App Tutorial
- Web App Tutorial
- iOS App Tutorial
- Using SQLite