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

Home » Public Forums » archive » Default values for keywords
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Default values for keywords [message #90780] Wed, 15 April 2015 11:21 Go to previous message
Gordon Farquharson is currently offline  Gordon Farquharson
Messages: 48
Registered: December 2010
Member
I have been a long time IDL user, but it has only just occurred to me to ask whether there is a more elegant way to set default values for keyword parameters than

if n_elements(foo) then foo = !pi

I suspect there isn't, but this makes the start of most IDL routines very cluttered. It would be cool if there was a way to set the default value, like in C++ constructor calls. Maybe something like,

pro bar, AKP=akp

DEFAULT_BLOCK
apk = 1.0
END_DEFAULT_BLOCK

...

END

I'm sure somebody could come up with a more elegant syntax.

Just a thought.

Gordon
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: contour and LABEL_FORMAT not playing nicely
Next Topic: Regridding NCEP Data

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

Current Time: Wed Oct 08 09:23:00 PDT 2025

Total time taken to generate the page: 0.00392 seconds