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

Home » Public Forums » archive » Re: writing a structure with pointers
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: writing a structure with pointers [message #12279] Wed, 15 July 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Lisa Bryan (lbryan@arete-az.com) writes:

> Could someone tell me the easiest way to do the following.
>
> state = {.....big long huge structure with many substructures and lots
>
> of pointers all over the place....}
> writeu,unit,state
>
> I'm trying to write my state structure into an unformatted file and
> get the error:
>
> WRITEU: Expression containing pointers not allowed in this context:
> STATE.

Oh, oh. Looks like someone will have to write a recursive
procedure to example the fields of structures and dereference
the pointer fields. It is a shame there isn't a DEREFERENCE
keyword that could be used with the WRITEU command.

The alternative, of course, is to SAVE the structure. SAVE
will store the pointers along with the data they point to, so
that all can be RESTORED later. This is not always my preferred
solution, since it is not guaranteed to work with IDL upgrades
and variables that are not named carefully can be a problem.
I can imagine that pointer variables might be even more
difficult to handle than normal variables.

Absent RSI adding some capability to WRITEU, how about you
let us know when you have this program written, Lisa. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Animated Gif Tool?
Next Topic: MPEG file creation

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

Current Time: Fri Oct 10 15:42:03 PDT 2025

Total time taken to generate the page: 2.16003 seconds