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

Home » Public Forums » archive » Re: determining if a structure has a given tag
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: determining if a structure has a given tag [message #66918] Wed, 17 June 2009 17:12 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Jun 17, 8:09 am, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:
> Jeremy Bailin schrieb:
>
>
>
>> I'm sure there is a simple answer to this, but I can't find it.
>
>> Does someone know of a programmatic way to determine if a given tag is
>> defined in a structure, without resorting to TAG_NAMES (which seems
>> downright ugly). I can do something like
>
>> if n_elements(variable) eq 0
>
>> to determine if a variable has been defined, but to figure out if a
>> structure tag is defined I need to grab a list of all tags?? I guess I
>> want something that's functionally equivalent to:
>
>> if total(tag_names(struct) eq strupcase(tag)) gt 0
>
>> but which doesn't make me shudder. The closest discussion I can find
>> on this is here:
>> http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thr...
>> ...but most of that focuses on the peculiarities of dealing with
>> _EXTRA, not the more generic case.
>
>> -Jeremy.
>
> Result=is_tag(structure,tagname)
>
> http://www.fz-juelich.de/icg/icg-1/idl_icglib/idl_source/idl _html/dba...
>
> cheers
> Reimar


So the basic answer appears to be "no, you can't do it without using
TAG_NAMES, but you can encapsulate it inside another function so you
don't notice." ;-)

-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Map Projection Conversion in ENVI
Next Topic: Re: POLAR_CONTOUR plot giving strange values for contour lines

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

Current Time: Wed Oct 08 15:33:28 PDT 2025

Total time taken to generate the page: 0.00398 seconds