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

Home » Public Forums » archive » Re: Optional parameters
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: Optional parameters [message #38199 is a reply to message #38198] Tue, 24 February 2004 08:10 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 23 Feb 2004 18:05:20 -0700, David Fanning wrote:

> Michael Wallace writes:
>
>> The learning of IDL continues.... today's question is about optional
>> parameters. Specifically, how do you make a parameter optional? I can
>> find stuff in the IDL documentation regarding position parameters and
>> keywords, but I haven't found anything yet about optional parameters.
>> So, how do you create optional parameters and what are common gotchas
>> with using them?
>
> An optional parameter can be either a positional parameter or a keyword
> parameter, although the general rule of thumb is that positional
> parameters are always required and keyword parameters are always
> optional. The rule is broken frequently, especially with positional
> parameters and less so with keyword parameters (having to suffer
> the wrath of Coyote if you violate the "keyword is optional" dictum
> probably accounts for the decreased frequency of the latter).
>

I would have put it more simply: all parameters, keyword or
positional, are optional in IDL. How you choose to treat missing
parameters defines the behavior of a routine. See David's linked
article for more. I think there are enough useful example (even among
RSI's own offerings) which violate this general rule of thumb that it
shouldn't be considered a rule.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: pointer and structure stuff ...
Next Topic: Re: Something similar to a "Widget_Container" ?

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

Current Time: Sat Oct 11 06:16:11 PDT 2025

Total time taken to generate the page: 1.28038 seconds