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 #71266 is a reply to message #71119] Wed, 02 June 2010 15:22 Go to previous message
fgg is currently offline  fgg
Messages: 67
Registered: April 2010
Member
On Jun 2, 3:17 pm, fgg <fabioguimaraesgoncal...@gmail.com> wrote:
> On Jun 2, 3:12 pm, pp <pp.pente...@gmail.com> wrote:
>
>> Use keywords instead of positional arguments:
>
>> pro name, mode, s1=s1, s2=s2
>
>> That way, when calling the routine you can use any order, or omit any
>> argument, and they still get associated to the right variables. Also
>> consider replacing s1 and s2 by more descriptive names, to make it
>> easier for users to know what the arguments mean. With keywords, you
>> can still use the short names inside your routine:
>
>> pro name, mode, some_argument_name_1=s1, some_other_argument=s2
>
> Thank you, pp. So if mode=2 and I want to make s2=100 then all I need
> is:
>
> proname, 2, s2=100  ?

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.
[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: Sat Oct 11 04:24:03 PDT 2025

Total time taken to generate the page: 0.40472 seconds