Re: Declaring constants [message #32807] |
Thu, 07 November 2002 14:38 |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
Nidhi Kalra wrote:
> Is there any way to declare constants in IDL as you might in C header
> files or Java classes?
>
> -Nidhi
You have a couple of options.
1) Create a function, for instance
function twopi
return,2*!dpi
end
1b) similarly you could put it in an object
2) make a system variable (and perhaps put it in our startup.pro)
DEFSYSV, '!twopi', 2*!dpi
These would come in very handy should the value of pi ever change :)
Cheers,
bob stockwell
|
|
|
Re: Declaring constants [message #32808 is a reply to message #32807] |
Thu, 07 November 2002 13:52  |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
nrk5@cornell.edu (Nidhi Kalra) writes:
> Is there any way to declare constants in IDL as you might in C header
> files or Java classes?
> -Nidhi
Perhaps DEFSYSV is what you want, e.g.
DEFSYSV,'!lightspeed',2.99773E+10
Bill Thompson
|
|
|