[Gambas-user] Using special method _unknown for object properties
Benoît Minisini
gambas at ...1...
Mon Jun 27 01:33:00 CEST 2011
> To the group:
> Here is my problem. I need to use the "_unknown" special function to
> simulate object methods and properties at runtime. I coded an
> "_unknown" method in a class called DITEM If ditem is an instance of
> DITEM and I refer to ditem.A() where A is NOT a method in DITEM,
> everything works fine. My "_unknown" method gets called and I can
> retrieve the arguments (if there are any) and handle the reference just
> fine. I was expecting that I could also use this for properties. In this
> case, I would expect to make a reference to ditem.b (such as PRINT
> ditem.b) and my _unknown method would again be called with the value of
> isProperty being true and I could process the reference dynamically.
> Well, as I said, the first instance (the method call) works just fine.
> The second case does not. When I refer to ditem.b, my _unknown method
> NEVER gets called, so I can't process the illegal reference. What I DO
> get is (function ?) printed on the console. Is this a bug in Gambas, or
> am I doing it wrong? If the former, is it a bug in all versions, or just
> some (I am running 2.19)? Does it work in Gambas3? I really need to find
> a fix for this before I can proceed with a big port. Thanks
> gwalborn
It works in Gambas 3, but I'm afraid I cannot backport the fix to Gambas 2...
Regards,
--
Benoît Minisini
More information about the User
mailing list