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

Home » Public Forums » archive » Treating an object as a structure
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: Treating an object as a structure [message #65508 is a reply to message #65432] Thu, 05 March 2009 08:01 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
llo wrote:
> On Mar 4, 4:59 pm, David Fanning <n...@dfanning.com> wrote:
>> llo writes:
>>> It works but the problem is that the struct is not the object itself.
>> No, that's pretty much the point of objects. :-)
>
> That's not true David. You can get all the object attributes doing
> this:
>
> a=OBJ_NEW('object')
> str=CREATE_STRUCT(NAME=OBJ_CLASS(a))
> STRUCT_ASSIGN, a, str
>
> Now, ypu have all the attributes of a in the struct str.
>
> Cheers,
>
> Bernat
>
>

Not so fast! That trick only works inside an object's methods:

IDL> a=OBJ_NEW('idlgrmodel')
IDL> str=CREATE_STRUCT(NAME=OBJ_CLASS(a))
IDL> STRUCT_ASSIGN, a, str
% STRUCT_ASSIGN: Object instance data is not visible outside class
methods: A
% Execution halted at: $MAIN$

Mike
--
www.michaelgalloy.com
Associate Research Scientist
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: netCDF Read/Write Variable
Next Topic: Probably a Stupid Question

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

Current Time: Sun Oct 12 06:21:24 PDT 2025

Total time taken to generate the page: 0.79996 seconds