object association [message #72389] |
Thu, 02 September 2010 06:57 |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi guys,
I'm using IDL 7.0... Do you know if there is a way to use the
attributes of an associated object without using GetProperty and
SetProperty methods ?
An example:
#############################
## Class a
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
The statement self.reference.int=9 in the method b::test does not work
at all. Do you know if there is a way to do that without using the
GetProperty and SetProperty methods ?
Thanks,
nata
|
|
|