[Gambas-user] Using special method _unknown for object properties
Gary D Walborn
gwalborn at ...626...
Thu Jun 23 15:32:04 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Verify This Message with Penango.p7s
Type: application/pkcs7-signature
Size: 3533 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20110623/f8145845/attachment.bin>
More information about the User
mailing list