Recreating C# static types in Visual FoxPro Code classes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Tests
.gitignore
.gittimestamp
FT_ARRAY.md
FT_DATETIME.md
FT_STRING.md
FoxTypes.zip
README.md
Static.prg
datetime.PRG
static.BAK
string.PRG

README.md

FoxTypes

Recreating C# static types (String, DateTime, Array) in Visual FoxPro Code classes

Why?

Visual FoxPro originated from dBase, and retained its procedural roots for backward compatibility even while the rest of the world moved to object-oriented syntax. This project aims to collect the myriad procedural functional under static classes. This will give us:

  • Consistency (because all commands start with the type, e.g. STRING.IndexOf() rather than AT() )
  • Intellisense (because who can remember the name of that function that joins elements of an array into a string?)
  • Compatibility (lowering the learning curve for other languages)

Usage

Instantiate the class once and you're ready to use it. For maximum efficiency, add the instance into the _VFP object, which will make it available anywhere in your app and don't have to worry about it going away with any CLEAR statement.

SET PROCEDURE TO STRING.prg ADDITIVE
ADDPROPERTY(_vfp, "STRING", CREATEOBJECT("String"))
? _VFP.STRING.Format("Hello {0}!", "World")

The FoxTypes

Tests

There are many unit tests in the \tests folder for examples of usage