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

Home » Public Forums » archive » Re: Evaluate a string as a variable name
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: Evaluate a string as a variable name [message #70809 is a reply to message #70723] Tue, 04 May 2010 19:31 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On May 4, 10:48 am, laurel <laur...@gmail.com> wrote:
> Brilliant! Thanks so much.
> -Laurel

The IDL Astronomy library also has the very handy routine TAG_EXIST(),
which allows you to query structure members by name.

You would do something like this.
if tag_exist(struct, x, index=ii) then begin
y = struct.(ii)
endif else begin
message, "ERROR: could not find '"+x+"' in structure"
endelse

TAG_EXIST() appears to be completely stand-alone, i.e. no dependencies
on other functions in the library.
http://idlastro.gsfc.nasa.gov/ftp/pro/structure/tag_exist.pr o

Craig
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: problem with
Next Topic: Creating a new image from an image input in IDL

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

Current Time: Sun Oct 12 00:02:08 PDT 2025

Total time taken to generate the page: 0.01049 seconds