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

Home » Public Forums » archive » logical_true vs nothing in an if statment
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: logical_true vs nothing in an if statment [message #85932 is a reply to message #85931] Wed, 18 September 2013 14:37 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  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?
[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
Previous Topic: idl: turn string value into variable name part2
Next Topic: Reading large files with restore

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

Current Time: Sat Oct 11 21:14:51 PDT 2025

Total time taken to generate the page: 1.76055 seconds