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 #64071 is a reply to message #63986] Thu, 27 November 2008 13:53 Go to previous messageGo to previous message
Mark[1] is currently offline  Mark[1]
Messages: 66
Registered: February 2008
Member
On Nov 26, 3:29 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> Ah.  That significantly restricts the utility of
>
> SWITCH N_PARAMS() OF
>    0 : ...
>
> ENDSWITCH
>
> to provide default values for optional parameters.

Indeed. N_ELEMENTS is what you need for that. The only use I have
found for N_PARAMS is for writing wrapper routines

pro wrapper, P1, P2, P3, P4, _REF_EXTRA=_extra
;; Do some other stuff
case n_params() of
0: wrappee, _STRICT_EXTRA=_extra
1: wrappee, P1, _STRICT_EXTRA=_extra
2: wrappee, P1, P2, _STRICT_EXTRA=_extra
3: wrappee, P1, P2, P3, _STRICT_EXTRA=_extra
4: wrappee, P1, P2, P3, P4, _STRICT_EXTRA=_extra
endcase
end

Ugly, but sometimes necessary.
[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: Thu Oct 09 21:40:54 PDT 2025

Total time taken to generate the page: 0.72047 seconds