comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Object SetProperty Not inherited
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Object SetProperty Not inherited [message #78870 is a reply to message #78869] Wed, 04 January 2012 17:41 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
godber writes:

> Using IDL 8.1 I am having a hard time setting properties on objects as the documentation suggests I can. Using the sample object from the documentation:
>
> PRO myObjectClass__define
> structure = { myObjectClass, $
> PROPERTY1: 0L, $
> PROPERTY2: '', $
> INHERITS IDL_Object $
> }
> END
>
> I then instantiate and try to set a property as follows and I get an undefined method error
>
> IDL> o = Obj_New('myobjectclass')
> % Compiled module: MYOBJECTCLASS__DEFINE.
> IDL> o.property2 = 'foo'
> % Attempt to call undefined method: 'MYOBJECTCLASS::SetProperty'.
> % Execution halted at: $MAIN$
>
> The documentation suggests that subclassing IDL_Object should make using the dot operator possible:
>
> "If your object inherits from the IDL_Object class, you can set or change the object's properties after object initialization by calling the property directly using the dot operator:
>
> Obj.PROPERTY = value, ...
> "
>
> What am I missing?

You have to write the SetProperty and GetProperty methods
for this object class. Then, you can use the "dot" operators
to call the methods like you are doing.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL
Next Topic: IDL help online

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 21:47:43 PDT 2025

Total time taken to generate the page: 0.56356 seconds