Re: logical_true vs nothing in an if statment [message #85932 is a reply to message #85931] |
Wed, 18 September 2013 14:37   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
On 09/18/13 16:22, Michael Galloy wrote:
>
> But, you can change this behavior in selected routines with the
> logical_predicate compile option:
>
> IDL> for i = 0, 10 do if i then print, 'true' else print, 'false'
> false
> true
> false
...etc...
> IDL> compile_opt logical_predicate
> IDL> for i = 0, 10 do if i then print, 'true' else print, 'false'
> false
> true
> true
...etc...
True (pun intended :o), and the OP should make sure the option is put in
the procedure/function in question, not an IDL startup file!
Also, what if someone writes code based on the false/true ping-pong
behaviour, and then gives the code to someone else that DOES have the
logical_predicate option set in a startup file?
Would hilarity ensue?
|
|
|