Re: Object Funkiness [message #9730 is a reply to message #9658] |
Mon, 04 August 1997 00:00  |
J.D. Smith
Messages: 214 Registered: August 1996
|
Senior Member |
|
|
Phil Williams wrote:
>
> J.D. Smith wrote:
>>
>> J.D. Smith wrote:
>>>
>>> OK OOP experts. Here's a conundrum...
>>>
>>> here's a procedure to test dynamic binding of methods in IDL...
>>>
>>> pro testdb
>>> a=obj_new('eeke','a')
>>> b=obj_new('eeke','b')
>>> list=[a,b]
>>> ran=fix(randomu(sd) ge .5)
>>> list[ran]->Message, ran, 1-ran
>>> obj_destroy,list
>>> return
>>> end
>>>
>>> and the file eek__define.pro contains:
>>>
>>> pro eeke::Message, ran, ran2
>>> print,self.val,' random: ',ran, ran2
>>> return
>>> end
>>> function eeke::Init,val
>>> self.val=val
>>> return,1
>>> end
>>> pro eeke__define
> ^^^^^^^^^^^^^^^^^
> The __define method should be a FUNCTION. I'm sure once this is done
> everything should work fine.
>
>>> struct={eeke,val:''}
>>> return
>>> end
>>>
>
> phil
I think perhaps you're thinking of the INIT class method -- __defines
are in fact procedures, I believe. It's really a problem with the
compiler parsing method names incorrectly for methods which shadow IDL
builtin's, with some conditions affecting whether the error will occur.
I've alerted RSI Tech Support and they're working on it, but for now,
avoid method names such as 'Message', 'Wait', 'Wset', and likely several
more.
JD
|
|
|