Post
by Jarmo Muukka » 22 Apr 2005, 13:18
Posted by: Jarmo Muukka
To me SQLWindows has never had a real Boolean datatype. It allows you to set
bSuccess = anyNumber. If you compare boolean to TRUE or FALSE, it just
compares number to 1 or to 0.
Set bSuccess = 2
If bSuccess = TRUE
! never executed, because 2 != 1
If Boolean would be true Boolean, then boolean variable would be TRUE when
non-zero number is assigned to it. But it's not. ;-(
To me numbers are not casted to boolean. Boolean is just a another word for
Number. Nothing else. If numbers are used in logical expressions like in
your examples, they are just checked are they non-zero.
Set nRet = 8
If nRet ! succeeds because 8 is non-zero
If nRet And TRUE ! succeeds because 8 and 1 are both non-zero
If nRet = TRUE ! does not succeed because 8 is not 1
Which one of these is a bug? In SQLWindows: none, unfortunately.
If this would be C# code then all three would cause compilation error.
JMu