--- In [email protected], "peternilsson42" <[EMAIL PROTECTED]>
wrote:
<snip>
> Note that C is not the only language with the difficulty.
> In Pascal (IIRC) and many Basics, it's the least significant
> bit that determines the true/false status. So for example,
> zero was false, 1 was true, 2 was false, 3 was true, etc...
<snip>

That depends on the compiler.
Under all more common Pascal compilers, BOOLEAN was a strictly defined
data type which (just like in Java) could not be intermixed with any
other data type (such integers or chars).
However, Borland's Turbo Pascal did allow you to define conditional
expressions of any integer data type; those expressions were
considered true if they did not equal zero (just like C). It has taken
me hours to detect a small glitch when indexing an ARRAY [BOOLEAN] OF
STRING because I had used an integer expression as the index instead
of a strictly boolean expression...

Regards,
Nico

Reply via email to