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

Home » Public Forums » archive » dealing with arguments
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: dealing with arguments [message #71262 is a reply to message #71119] Wed, 02 June 2010 15:52 Go to previous messageGo to previous message
fgg is currently offline  fgg
Messages: 67
Registered: April 2010
Member
On Jun 2, 3:43 pm, pp <pp.pente...@gmail.com> wrote:
>> Oh! And how do I set default values? For example, to make s2 always
>> equal 10 if no other value is provided in the call.
>
> pro name, mode, s1=s1, s2=s2
> s2=n_elements(s2) ne 0 ? s2 : 10
> ...
> end
>
> Which you could then call as
>
> name, 2, s2=100
>
> It would make s2=10 if it is not provided (or is given an undefined
> variable).
>
> By the way, it could also be called with
>
> name, s2=100, 2
>
> as it does not matter in which order you supply the keywords.

Thanks a lot for your help.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: dealing with arguments
Next Topic: trying to find land/water coverage maps for NA

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

Current Time: Thu Oct 09 22:31:31 PDT 2025

Total time taken to generate the page: 0.00501 seconds