Guys,
What a very good question, and also some very good answers.
In addition to what Chris already said (and I agree about FtpWebRequest):
- The dialect of a project controls the behavior of the compiler. For example:
x Setting the FoxPro dialect enables the FoxPro "DEFINE CLASS" syntax and some other FoxPro specific language constructs.
If you look in the Parser definition, you can see that some parser rules are prefixed with {IsFox}?
https://github.com/X-Sharp/XSharpPublic ... /XSharp.g4
The compiler also uses the "foxsource" rule as entry point, to allow for statements at the start of the file before the first function/procedure/class
x Setting the VO dialect enables VO specific rules, like the VO structure and Union. The same file contains {IsVO}?
x The compiler dialect also tells the compiler which runtime DLLs are mandatory (for example, FoxPro classes can inherit from a FoxPro specific parent class).
This DLL also contains the code for the FoxPro specific handling for the WITH .. ENDWITH statement and to decide at runtime if Foo(1,2) is a function call
or if this references a public array variable with the name "Foo". See below.
x The compiler automatically defines the define __DIALECT_FOXPRO__ or __DIALECT_VO__ etc. based on the chosen dialect.
This is used to control which header files for UDCs are used. In the XSharpDefs.xh you can find constructs like
#ifdef __DIALECT_FOXPRO__
#include "FoxProCmd.xh"
#endif
Also, the rule for TEXT ENDTEXT has a "common" implementation inside XSharpDefs.xh and a FoxPro specific implementation in the FoxPro header file.
The common rule is in a section that starts with #ifndef __DIALECT_FOXPRO__
- The FoxPro runtime DLL (XSharp.VFP.DLL) contains some of the "compiler support" functions and implementations of FoxPro runtime functions that do not exist or behave differently in other dialects.
The file
https://github.com/X-Sharp/XSharpPublic ... upport.prg has an Init procedure that
takes care of some of this. FoxPro also allows to update DBF files in shared mode without manual locking. Inside this file you can see that
an "AutoLock" and "AutoUnLock" function are registered inside the runtimestate.
You can also see some functions with names that start with "__". These are used by the compiler to implement specific features for the FoxPro dialect.
Now the VOInternetclasses DLL that you were referring to in your original question are compiled with the VO dialect. However, the code in there is compiled into normal .Net code, and can be used from any language, so also from X# in the VFP dialect, but also from C# and VB.
There are a few things to remember:
- In general, you should also include links to the DLLs that this depends on. These are XSharp.VO, VOSystemClasses, VOWin32APILibrary
- This DLL is compiled in x86 mode. So your VFP code should also be compiled in x86 mode. The reason for this is that on several places in the code Pointers and 32 bits numbers are "mixed". This is not ideal, but that was the case in Visual Objects, and we did not want to change the code
Robert