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 #66941 is a reply to message #66938] Tue, 16 June 2009 22:51 Go to previous message
dosfun is currently offline  dosfun
Messages: 14
Registered: February 2009
Junior Member
On 6月17日, 下午12时25分, Jeremy Bailin <astroco...@gmail.com> wrote:
> 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/bro wse_thread/thr...
> ...but most of that focuses on the peculiarities of dealing with
> _EXTRA, not the more generic case.
>
> -Jeremy.


IF Where(Tag_Names(struct) EQ StrUpcase(tag)

Maybe tag_names is not so ugly.
[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 19:24:58 PDT 2025

Total time taken to generate the page: 0.00493 seconds