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

Home » Public Forums » archive » Re: delete a tagname from 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: delete a tagname from a structure? [message #9705 is a reply to message #9702] Fri, 08 August 1997 00:00 Go to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
R. Bauer wrote:
>
> Hi,
>
> I like to remove a tagname from a structure.
>
> Any ideas?
>
> --
> R.Bauer
>
> Institut fuer Stratosphaerische Chemie (ICG-1)
> Forschungszentrum Juelich
> email: R.Bauer@fz-juelich.de


st={tag1:1,tag2:2,tag3:3,tag4:4} ; a structure
tags=tag_names(st)
list=[0,1,3] ;; list of which elements to keep
st=create_struct(tags[list],st.(list[0]),st.(list[1]),st.(li st[2]))


If you have a named struct, you can use
name=tag_names(st,/STUCTURE_NAME) and create_struct(name=name,...)

For a totally general method which doesn't preassume the number of tags
to keep, you'd have to build an 'execute' statement.

E.g.

n=strtrim(n_elements(list),2)
exc='st=create_struct(tags[list],'+string(FORMAT='('+n+'("st.(list[ ",I0,"])",:,","))',indgen(n_elements(list)))+')'
out=execute(exc)

JD
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Least Square
Next Topic: differnces in structures for idl5

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

Current Time: Wed Oct 08 15:51:56 PDT 2025

Total time taken to generate the page: 0.00450 seconds