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

Home » Public Forums » archive » Re: Finding if a structure tag name is defined?
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: Finding if a structure tag name is defined? [message #36693 is a reply to message #36688] Tue, 14 October 2003 19:35 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
wmc@bas.ac.uk wrote:
> David Fanning <david@dfanning.com> wrote:
>
>> Reimar Bauer writes:
>>
>>> I often use is_tag to determine if a tag is in a structure
>
>> But, alas, you are still going to have to call IS_TAG
>> as many times as you have letters in your keyword, if
>> you hope to fish it out unambiguously. :-(
>
> Hmm, so, isn't that a flaw in IDL? Taking on board your
> well-reasonsed critique of (over)using _extra, it still seems
> quite reasonable to expect to be able to find if a given tag
> exists in a given structure, via a mechanism as simple as
> using n_elements to see if a given variable exist. IDL seems
> to make this simple task harder than it should be.
>
> (and anyway, looking at the pro, it only needs calling once).

I thought David's point was that searching for a tag in the _EXTRA
structure (which is a little harder than it should be in IDL, but not
all that onerous) is something you generally should not do, because it
becomes laborious if you want to support keyword abbreviation. And of
course you *do* want to handle keyword abbrevation, unless you want to
write documentation that says "IDL allows abbreviated keywords, except
in my routines".

If you aren't interested in a keyword in the current routine, bundle it
in an _EXTRA structure (or _REF_EXTRA hidden string-array thingy). If
you do, declare it explicitly.

--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: What does an optimal scientific programming language/environment need?
Next Topic: efficient polynomial fitting

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

Current Time: Wed Oct 08 19:05:33 PDT 2025

Total time taken to generate the page: 0.00450 seconds