[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

assignment inside boolean expression



I was wondering if it's common knowlege that one can put an IDL
assignment inside
a boolean expression (like in the C language).  For example

if (v = 0) then ...    assigns v and does not execute the "then"
statement, while
if (v = 1) then ...    assigns v and does execute the then.

Just as in C I find this leads to really nasty bugs.


--
====================================================================
Patrick S. Broos, Systems Analyst/Programmer    patb@astro.psu.edu

Department of Astronomy and Astrophysics  My office   814-863-7947
Penn State University
525 Davey Lab                             FAX         814-863-8686
University Park, PA  16802-6305
http://www.astro.psu.edu                  Group office    863-9550
====================================================================