Johan Nel wrote:Hi
Well have not tested with the VFP syntax, but you can in X# core already have interfaces:
Code: Select all
CLASS MyClass INHERIT Foo IMPLEMENTS IFoo1, IFoo2, IFoo3
// And overloaded methods
CONSTRUCTOR()
RETURN
CONSTRUCTOR(i AS INT)
RETURN
CONSTRUCTOR(s AS STRING)
RETURN
END CLASS
Hi Johan,
In regular vfp we have in the corresponding define class command the clause
Code: Select all
[IMPLEMENTS cInterfaceName [EXCLUDE] IN TypeLib | TypeLibGUID | ProgID ]
which is used when attaching to the events and methods of a COM object.
Attaching to COM should still be supported for all those automating Word or Excel. Due to COM rules any method/event has to be explicitly coded, which at least for C#8 IL has been eliminated.
If the compiler can keep "Implements" while pointing to DotNet-interfaces all the better - but not the main point.
Vfp has no command to
define a new interface, this is mangled in with the definition of COM objects
[/code]
DEFINE CLASS myOLEClass AS Custom OLEPUBLIC
MyProperty = 5.2
* Set COM attributes for MyProperty.
DIMENSION MyProperty_COMATTRIB[4]
myProperty_COMATTRIB[1] = COMATTRIB_READONLY
myProperty_COMATTRIB[2] = "Help text displayed in object browser"
myProperty_COMATTRIB[3] = "MyProperty" && Proper capitalization.
myProperty_COMATTRIB[4] = "Float" && Data type
ENDDEFINE[/code]
so for Dotnet/IL interfaces I would hope for something more succinct that compiles down to
which would add multi-inheritance to xSharp with no further effort. No idea if rest of vfp devs miss such options - I have no product I continously maintain, but work on projects, where I see in other languages benefits of shallow inheritance hierarchy coupled with some mixin tweaks.