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

Home » Public Forums » archive » Re: Changing elements in structures
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: Changing elements in structures [message #18315 is a reply to message #18301] Wed, 15 December 1999 00:00 Go to previous messageGo to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Alvaro wrote:
> I'm making a program that is a HDF viewer. My problem is how to pass
> information between widgets.
> I use a structure to pass the information but the problem is that at start I
> don't know the size of the data, which will be read later from a file. I use
> somethisg like this:
>
> info={filename:"", $
> data:IntArr(1,1) }
>
> I use IntAr(1,1) because I don't the size until I open the filename
> Can I change the size and also the type (Int to Float or Byte) of the tag
> "data" of the structure?

You cannot change the size of type of a variable in a structure without
re-creating the structure.

> Have you got any idea to do this, perhaps using pointers?

;- Define the structure
info = {filename:'', data_ptr:ptr_new(1.0)}

;- After you've read the data, store it in the structure
data = dist(256)
*info.data_ptr = data

;- Use the data
data = *info.data_ptr
tvscl, data

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Widget Frame Attributes on Linux
Next Topic: discrete cosine transform

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

Current Time: Sat Oct 11 08:29:20 PDT 2025

Total time taken to generate the page: 1.36242 seconds