[fpc-devel] compiler bug?

Nico Aragón nico at espira.net
Thu Dec 30 22:22:27 CET 2004


El Jueves, 30 de Diciembre de 2004 22:01, peter green escribiste:
> you are forciblly putting an out of range value in a variable what do you
> expect to happen?

I think it's slightly subtler. I guess that this code:

  if not b then
     WriteLn('False')
  else if b then
     WriteLn('True')
  else
     WriteLn('Other');

...could throw a different result.

IIRC, any non-zero value is evaluated as "True" for a Boolean variable. The 
problem with the case statement is that Jesús is asking the compiler which 
specific value it chooses for assignements... and getting surprised because 
it's not what he expected. I guess the compiler uses 1 instead of 255. But 
it's surely documented anyway.

-- 
saludos,

    Nico Aragón
    nico at espira.net
    http://espira.net/nico/





More information about the fpc-devel mailing list