[fpc-pascal] chr does not return an error when number bigger then byte enters

ik idokan at gmail.com
Wed Nov 14 17:33:54 CET 2012


Hello,

I'ved started a crossaide against PHP
(http://idkn.wordpress.com/2012/11/14/why-php-must-be-abandoned-in-my-opinion/),
due to few issues it have such as chr(256) will return ascii "0".
But then I tested it with FPC, and it acts exactly the same, while
many programming languages report on such value range check error.

begin
  writeln(chr(256)); // because it is constant, the compiler only yell warning
end.

Why does FPC allow such value to enter chr without raising something up ?

Ido



More information about the fpc-pascal mailing list