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

Home » Public Forums » archive » Re: work with 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: work with structures [message #73608 is a reply to message #73607] Wed, 17 November 2010 08:09 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Jean wrote:
> I have a program that takes a structure as one of its argument. I want
> this program to parse and display its contains.
>
> The structue may looks like this:
>
> structure = { var1: {label:'label of var1', value:'value of var1'},$
> var2: {label:'label of var2', value:'value of
> var2'},$
> ... }
>
> I'm not supposed to know in advance the name of var1. Using tag_names,
> I was able to retrieve those names, but know I need to get the label
> and value of each of them and this is where I'm stuck.
>
> of course doing something like
>
> list_var = tag_names(structure)
> for i=0,n_tags(structure)-1 do begin
> print, structure.list_var[i].label !!! not working

what about:
print, (structure.(i)).label

?

I may have overused the parentheses.

> endfor
>
> did not work !
>
> Any idea how I can do that ?
>
> Jean
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: PostScript Background Color Preference
Next Topic: NG Colorbar in IDL 8.0.1

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

Current Time: Thu Oct 09 21:11:55 PDT 2025

Total time taken to generate the page: 1.35690 seconds