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

Home » Public Forums » archive » Re: Is n_params() supposed to behave this way?
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: Is n_params() supposed to behave this way? [message #16841] Mon, 23 August 1999 00:00 Go to previous message
Mirko Vukovic is currently offline  Mirko Vukovic
Messages: 124
Registered: January 1996
Senior Member
In article <37C1B09A.704A7DC@ssec.wisc.edu>,
Liam Gumley <Liam.Gumley@ssec.wisc.edu> wrote:
> Mirko Vukovic wrote:
>
>> Consider the following code:
>>
>> pro sub1,arg1,arg2,arg3,arg4,arg5
>> message,/info,string(n_params())
>> return
>> end
>>
>> pro sub,arg1,arg2,arg3,arg4,arg5
>> message,/info,string(n_params())
>> sub1,arg1,arg2,arg3,arg4,arg5
>> end
>>
>> If at the command prompt I do
>>
>> sub,4
>>
>> IDL will print out
>> IDL> sub,4
>> % SUB: 1
>> % SUB1: 5
>>
>> In sub1 all arguments except the first one are still undefined.
>
> n_params() returns the number of non-keyword arguments passed (defined
> or not) to a procedure or function.
> n_elements(arg) will tell you if arg is defined.
>
> I think a case statement is your best bet.
>
> Cheers,
> Liam.
>
Ouch.

Thanks.

Mirko
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: exporting a Contour object
Next Topic: Re: Contour plot over 3D surface

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

Current Time: Sat Oct 11 01:24:55 PDT 2025

Total time taken to generate the page: 0.39946 seconds