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

Home » Public Forums » archive » Re: object association
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: object association [message #72386] Thu, 02 September 2010 10:32
natha is currently offline  natha
Messages: 482
Registered: October 2007
Senior Member
Thank you Mike ! It works !
Re: object association [message #72388 is a reply to message #72386] Thu, 02 September 2010 09:16 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 9/2/10 7:57 AM, nata wrote:
> FUNCTION a::Init
> RETURN, 1
> END
>
> PRO a__define
> struct = { a, int: 0, str: '' }
> END
>
> ## Class b
>
> FUNCTION b::Init, a
> self.reference=a
> RETURN, 1
> END
> PRO b::test
> self.reference.int=9
> END
> PRO b__define
> struct = { b, $
> reference: OBJ_NEW() }
> END
>
> #############################
>
> My code will be something like:
> a=OBJ_NEW('a')
> b=OBJ_NEW('b',a)
> b->Test

In one of those oddities of IDL, you should be able to access the
instance variables of *any* object when inside *any* method. IDL is just
having a hard time parsing your expression.

Try this for your b::test method:

PRO b::test
a = self.reference
a.int = 9
END

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to change button names on the dialog_message
Next Topic: split array

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

Current Time: Wed Oct 08 19:42:48 PDT 2025

Total time taken to generate the page: 0.00589 seconds