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 #64142 is a reply to message #63974] Wed, 03 December 2008 09:06 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Carsten Lechte writes:
>
>> Kenneth P. Bowman wrote:
>>> to provide default values for optional parameters.
>>
>> I wrote this little procedure for setting default values
>> that I use a zillion times a day:
>>
>>
>> PRO defaultarg, arg, defval, VALUEGIVEN=valuegiven
>>
>> IF N_ELEMENTS( arg) EQ 0 THEN BEGIN
>> arg = defval
>> valuegiven = 0
>> ENDIF ELSE valuegiven = 1
>>
>> END
>
> This is a pretty good idea. I can see how it would
> save some typing! :-)
>
> Here is a slightly modified version. I'll add this,
> with documentation, to the Coyote Library later today.

I have a doppelganger at work who takes all my good ideas
as soon as I publish them and points out all their deficiencies
and the obvious ways in which I could have made them better. :-(

To that end, I've updated the SetDefaultValue program I published
earlier to something a good deal simpler that also works in a more
intuitive way. You can find the update, if you are interested in
this sort of thing, here:

http://www.dfanning.com/programs/setdefaultvalue.pro

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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: Fri Nov 28 09:32:15 PST 2025

Total time taken to generate the page: 0.00827 seconds