Language Extensions
The VFPCompiler for .NET can compile and run your VFP programs unchanged, and that is a good start!. The main issue you'll find when compiling your VFP code is related to not yet implemented command and functions. We are working very hard on completing the VFP.Runtime so be sure to check every week if the command / function you are waiting for is already implemented.
The .NET framework also exposes constructs foreign to the VFP programmer like namespaces, structs, enums, events, delegates, method overloading and more. In order for VFPCompiler to have support for this new functionality some extensions had to be made.
| Classes and other Types like structures, enums, interfaces |
In addition to the normal classes now you can define several new types in VFP Code, that makes your code more readable and more performant. |
| Class members both instance and static members are discussed |
In VFP you could define Properties and Methods as members of classes.
Now you can also define fields, delegates, events, and special methods that are not bound to an object instance instead they can be called directly like:
MyClass::SomeMethod(para1...) |
| Defining Namespaces and USING namespaces |
Often is useful to Group classes into a Namespaces to give the users of your library a better idea of the functional areas. So instead of having 100 classes you can have 5 namespaces with maybe 20 classes each one.
You group related classes into the same namespace to expose a more logical organization of your classes and to avoid name clashes. |
| Attributes |
Atributes are a feature that enable you to "annotate" your classes, class members and parameters with additional info that can be useful in your programming context.
The .NET Runtime use thoroughly attributes for things like importing external functions, declaring the layout of classes, the marshaling behaviour of parameters, threading behavior (ThreadStatic) and more. |
| Strong typing |
This is an optional feature that gives you Compile Time checking of your code, and also because the compiler knows the type of your variable, it can speed up your code in the order of 5x-10x times.
All the dynamic capabilities are still there and you can mix dynamic with strong typed code in the same line giving you the best of both worlds. |
| Parameter extensions |
Now you have the ability to define what parameters are optional, the default value for optional parameters and can have methods that take an unlimited number of parameters by using varargs. |