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

Home » Public Forums » archive » Re: structure access using strings for tag-names
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: structure access using strings for tag-names [message #43421] Mon, 11 April 2005 07:02 Go to previous message
Thomas Pfaff is currently offline  Thomas Pfaff
Messages: 15
Registered: April 2005
Junior Member
> Try this out:
>
> ;get list of tag names
> tagnamelist=tag_names(!P)
>
> ;find which tag has the name "MULTI"
> tagindex=where(tagnamelist EQ 'MULTI')
>
> ;access the structure
> print,!p.(tagindex)
>
> You can use struct.(0), struct.(1) etc. to access the values
> in the first, second,... tag.
>
> --Paolo

That sounds fine. I had read about the access method using struct.(i)
but I had missed a possibility to get the index from the name.

By the way. Is anyone using structures this way, or do you prefer
something similar to the hash_table class, which I found on RSI's website.
Or do you use even different things for associative storage?

Thanks a lot,


Thomas
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: .compile vs .run
Next Topic: Re: tvimage, imcontour and ps dimensions

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

Current Time: Wed Oct 08 15:53:46 PDT 2025

Total time taken to generate the page: 0.00798 seconds