Lets consider these one by one:
1. IF var = %TRUE THEN...
This performs an explicit test for one value of "var" against the value of %TRUE (which is usually defined as -1)
2. IF var THEN...
This performs an implicit ISTRUE() function, and therefore any non-zero value of "var" will cause the code following the THEN clause to be executed.
3. IF ISTRUE var THEN... and IF ISTRUE(var) THEN...
These two statements function identically to #2 above.
4. IF ISFALSE var THEN... and IF ISFALSE(var) THEN...
These perform the opposite of #2 and #3 - if "var" is zero, then the condition is met.
5. IF NOT var THEN...
This is a completely different test - NOT performs a two's-compliment of "var", which is then implicitly tested for 'truth' or 'falsity'. See the help file for more info on the NOT bitwise operator.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Announcement
Collapse
No announcement yet.
Var = TRUE vs Var
Collapse
X
Leave a comment: