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

Home » Public Forums » archive » Re: Append tag to an array of 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: Append tag to an array of structures [message #34539 is a reply to message #34535] Wed, 26 March 2003 13:01 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
JD Smith wrote:
> Anyone have a clever method for appending a tag to an array of
> structures? For a single structure, it's easy:
>
> new_struct=create_struct(struct,'NewTag',1.21)

Well, I would hardly call it clever or efficient but one way is to
create a structure of the right size and then use the copy_struct.pro
procedure in http://idlastro.gsfc.nasa.gov/ftp/pro/structure/copy_struct. pro
to copy all the previous tag information

n = N_elements(struct)
new_struct = replicate(create_struct(struct[0],'NewTag',1.21),N)
copy_struct, struct, new_struct

--Wayne Landsman landsman@mpb.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Previous Topic: Re: console output under Windows
Next Topic: License increases?

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

Current Time: Wed Oct 08 15:14:55 PDT 2025

Total time taken to generate the page: 0.00479 seconds