tb0177.pp 601 B

1234567891011121314151617181920212223242526272829303132
  1. { Old file: tbs0211.pp }
  2. { a and not a is true !!! (if a:=boolean(5)) OK 0.99.11 (PM) }
  3. var
  4. a,b : boolean;
  5. c : byte;
  6. i : longint;
  7. procedure Error;
  8. begin
  9. Writeln('Error in bug0211');
  10. Halt(1);
  11. end;
  12. begin
  13. c:=5;
  14. a:=boolean(c);
  15. if a and not a then
  16. Begin
  17. Writeln('FPC is crazy !!');
  18. Error;
  19. End;
  20. i:=256;
  21. a:=boolean(i);
  22. { the value here is less trivial }
  23. { BP returns false here !! }
  24. { the problem is the converting wordbool to boolean }
  25. { if wordbool is 256 should not convert true to false !! }
  26. Writeln('boolean(256) =',a);
  27. end.