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

Home » Public Forums » archive » Re: Object as a member to object/class
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 as a member to object/class [message #58699 is a reply to message #58698] Tue, 12 February 2008 13:57 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Feb 12, 1:45 pm, Sven Utcke <utcke+n...@informatik.uni-hamburg.de>
wrote:
> I'm plainly too stupid for the following: I would like to have an
> object as a member to a second class.  I.e. I have something like
> this:
>
>   PRO MODBUS__DEFINE
>       struct = { MODBUS, Host:"hasgkssccdkal.desy.de", Port:502, tid:0L }
>   END
>
> and, later on,
>
>   PRO GKSSBC__DEFINE
>       struct =  { GKSSBC, Con:Obj_New(),  addr:'4020'XL, Factor:1.0, Steps:200, Micro:6 }
>   END
>
> Now, I would _like_ to do something like
>
>   FUNCTION GKSSBC::INIT,  addr = addr, factor = factor,  con = con
>       IF KEYWORD_SET(addr)   THEN self.Addr   = addr   ELSE self.Addr   = '4020'XL
>       IF KEYWORD_SET(factor) THEN self.Factor = factor ELSE self.Factor = 1.0
>       IF KEYWORD_SET(con)    THEN self.Con    = con    ELSE self.Con    = obj_new("modbus")
>       return,  1
>   END
>
> But even just doing
>
>   FUNCTION GKSSBC::INIT
>       self.Con = obj_new("modbus")
>       return,  1
>   END
>
> does't wor at all in IDL 6.4 (it results in something like:
>
>   % Object reference expression not allowed in this context: <OBJREF  
>     (<ObjHeapVar38(MODBUS)>)>.
>   % Execution halted at: GKSSBC::INIT       13
>     /afs/desy.de/user/u/utcke/src/Modbus/gkss9100C.pro
>   %                      OBJ_NEW        
>   %                      $MAIN$          
>
> So how does this _really_ work?
>
> Any help appreciated!

Your code works for me. The only thing I can think of is that you
might have changed the definition of self.con without .reset-ing or
exiting IDL?

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Software Developer II
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDLVM arguments
Next Topic: Using callable IDL from a Qt application

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

Current Time: Fri Oct 10 20:04:09 PDT 2025

Total time taken to generate the page: 1.04089 seconds