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

Home » Public Forums » archive » Re: Bug in N_PARAMS?
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: Bug in N_PARAMS? [message #63986 is a reply to message #63983] Tue, 25 November 2008 06:29 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.2394d6a934f41609989775@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:

> Kenneth P. Bowman writes:
>
>> I have been having some very odd problems with the N_PARAMS function lately.
>> ...
>> Am I missing something obvious here?
>
> N_PARAMS only tells you *how many* parameters the
> command is called with. It tells you nothing about
> the *type* of the parameter. Since "undefined" is
> a valid variable type in IDL, it is possible to
> pass an "undefined" variable and have it counted
> as a passed *number* of variables by N_PARAMS.
>
> If you are concerned with if a variable is undefined
> or not, you can't use N_PARAMS to determine this. The
> only way to tell is to use N_ELEMENTS.

Ah. That significantly restricts the utility of

SWITCH N_PARAMS() OF
0 : ...

ENDSWITCH

to provide default values for optional parameters. I suppose
that is the only way it could work with positional parameters,
as you might have an undefined parameter in the middle of the
list.

Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: areas with 'hatching' in plots?
Next Topic: Bug in N_PARAMS?

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

Current Time: Wed Oct 08 19:03:47 PDT 2025

Total time taken to generate the page: 0.00459 seconds