C
CBFalconer
Nicholas said:CBFalconer said:Especially since this is way OT for c.l.c, this gross error needs
correction. Pascal always defined booleans as the enumeration
false, true. Check Jensen & Wirths "Pascal Report and User Manual"
if you don't believe me.
You might also want to check to see what the compiler actually does.
The (D5 Pro UP1) compiler produces two different output depending on
the check of true is being done.
If you have this kind of comparision happening:
if SomeFunction() = true then
begin
end;
then the compiler will test to see if the result from SomeFunction()
is equal to 1 ($[00]01).
However, if you have this kind of comparision happening:
if SomeFunction() then
begin
end;
then the compiler will test to see if the result from SomeFunction()
is not zero!
If SomeFunction does not return a boolean (see 1st para. above) you
should have a syntax error, and the thing just doesn't compile. I
can't speak for compilers that don't implement Pascal. If you want
to test something for non-zero all you have to do is say so:
IF junkfunction <> 0 THEN ...
This is way OT for c.l.c, so I am setting f'ups. I won't see any
reply. BTW, Delphi does not implement Pascal. At least these days
they have the grace not to claim it does. Pascal has an ISO
standard.