Description »
To fully use the functionality of .NET Extender it is recommended to understand a little terminology related to the .NET Framework.
Assembly
An assembly is an EXE file, DLL file or a combination of several files; which usually contain Public Types (classes, structures) that you can use in your programs.
Although there are assemblies which only have resources inside, the most useful assemblies are the ones with public types which expose functionality that you consume in your programs.
You usually make an assembly accessible using SetCLRClassLibrary or by creating an object directly from the assembly through CLRNewObject.
Types (Enums, Structures and Classes)
These are Data Structures which are exposed by the .NET Framework.
Namespaces
A NameSpace is a way to group related types into a coherent name hierarchy. For example the System::Windows::Forms namespace groups a lot of types related to Forms and Controls. Inside a NameSpace every Type name has to be unique.
A NameSpace also helps Programmers to avoid name collision. For example in the .NET Framework there are several classes named Control, but because these classes are contained into different NameSpaces there are not name collisions.
For example, the Checkbox type contained in the System::Windows::Forms NameSpace is referenced from .NET Extender using its FullName: System::Windows::Forms::CheckBox.
Overloaded methods or Method overload
In VFP, given a method name you can only define one method with that name. This is in contrast with the .NET Framework where you can have several methods with the same name differing between them in the number of parameters and / or parameter types.
.NET Extender for VFP lets you access these overloaded methods like you would expect, using the common name. Because of the potential of overload, the arguments you pass to the method are also used to choose the best overload to call.
For example:
Give this class in the VFP language as of VFPCompiler for .NET with the overloaded method MethodA
DEFINE CLASS MyClass as System::Object
PROCEDURE MethodA
LPARAMETERS aValue as Integer
RETURN aValue
PROCEDURE MethodA
LPARAMETERS aValue as String
RETURN LEN(aString)
ENDDEFINE
oMyClass = CLRCreateObject("MyClass")
oMyClass.MethodA(5) && Calls the integer version Returns 5
oMyClass.Method("eTecnologia") && Calls the string version returns 11
Example »
Give this class in the VFP language as of VFPCompiler for .NET with the overloaded method MethodA
DEFINE CLASS MyClass as System::Object
PROCEDURE MethodA
LPARAMETERS aValue as Integer
RETURN aValue
PROCEDURE MethodA
LPARAMETERS aValue as String
RETURN LEN(aString)
ENDDEFINE
oMyClass = CLRCreateObject("MyClass")
oMyClass.MethodA(5) && Calls the integer version Returns 5
oMyClass.Method("eTecnologia") && Calls the string version returns 11