Re: _extra [message #50732 is a reply to message #1785] |
Wed, 11 October 2006 15:26  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dometz writes:
> Is there a way to extract certain parameters by name from _extra?
You can find the tag or field names in a structure with
TAG_NAMES. So you could check if there was a field
named SPY in the structure, like this:
index = WHERE(TAG_NAMES(_extra) EQ 'SPY', count)
And you could get the value of the SPY keyword like this:
IF count GT 0 THEN spy_value = _Extra.(index)
But, remember, keywords can be shortened to the fewest
number of characters to make them unique keywords, so
if you want to find SPY, you might well have to look
for "S" and "SP", as well as "SPY". Just hope you
don't have to deal with really long keyword names. :-)
Actually, there is a trick that Dave Burridge once
taught me that make this simpler. I probably involves
STREGEX, but I can't for the life of me think what
it was right now. Sorry. :-(
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|