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

Home » Public Forums » archive » Re: How to make an attribute of the oject visible outside of the class
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: How to make an attribute of the oject visible outside of the class [message #56228] Fri, 12 October 2007 16:54
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
natha wrote:
> Hi people,
> If I have an object like this:
> PRO objectA__define
> struct = { objectA, $
> a:0L $
> }
> END
> and another object like this:
> PRO objectB__define
> struct = {objectB, $
> A:OBJ_NEW(objectA) $
> }
> END
>
> How can I do for in a method in the class objectB treat with
> self.A.a ??? Is it possible?
> My code is more complex that this example and for the moment I resolve
> this problem using pointers..
>
> I'm grateful for any suggestions
>
> bye
>

You have 2 options...
1) object B inherits from object A, so all attributes and methods of A
are available for B
struct = {objectB, $
A:OBJ_NEW(objectA) $
INHERITS A
}

2) create a method in object A that returns the variable you want, then call
print, self.A -> return_a()
and if needed, another one to write the value a
self.A -> write_a, newValue

Jean
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to make an attribute of the oject visible outside of the class
Next Topic: how to get pixel data corresponding to some coordinates' points?

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

Current Time: Wed Oct 08 20:04:31 PDT 2025

Total time taken to generate the page: 0.04006 seconds