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

Home » Public Forums » archive » Re: IDL 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: IDL Structures [message #1690] Thu, 10 February 1994 23:38 Go to previous message
stl is currently offline  stl
Messages: 70
Registered: February 1994
Member
In article <2je7gn$1kn@kirk.giss.nasa.gov> crdmi@vulcan.giss.nasa.gov writes:
>
> I've noticed that IDL seems to treat all structures as arrays of
> structures.
>
> Example:
> IDL> a={ new_structure, x : 1e0, y : 1e0 }
> IDL> help, /structure, a
> A STRUCT = -> Array(1)
>

Actually this is kind of nice that they are all treated like arrays. If
you need to use the scalar of this, just use a(0), or actually like the
other person just mentioned, something like a.x should just return you a
scalar (otherwise use a(0).x)
The advantage of this is that when you use replicate on the
structure, you don't change from a scalar to an array, ie, very
little code change (if any at all)

-stephen

--
Stephen C Strebel / SKI TO DIE
stl@maz.stl.ch / and
Swiss Meteorological Institute, Zuerich / LIVE TO TELL ABOUT IT
01 256 93 85 / (and pray for snow)
[Message index]
 
Read Message
Read Message
Previous Topic: coloring buttons (widgets)
Next Topic: Wavelet transforms

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

Current Time: Wed Oct 08 19:39:37 PDT 2025

Total time taken to generate the page: 0.00460 seconds