range check error
Original Reporter info from Mantis: alexei
-
Reporter name: Alexei Chipovalov
Original Reporter info from Mantis: alexei
- Reporter name: Alexei Chipovalov
Description:
In Delphi compatibility mode.
Format %x for DWORD with 1 in high bit results in range check error (compilation and run-time).
Format('Z=%x',[$F0F0F0F0])
Z:=$F0F0F0F0;
Format('Z=%x',[Z])
Steps to reproduce:
{$APPTYPE CONSOLE}
program Test;
uses
SysUtils;
var Z;
begin
Z:=$F0F0F0F0;
// next line works OK
writeln('Z=',Z);
// next line produces compilation error "Error: range check error while evaluating constants"
// writeln(Format('Z=%x',[$F0F0F0F0]));
// next line gives run-time error: "ERangeError : Range check error"
writeln(Format('Z=%x',[Z]));
end.
Mantis conversion info:
- Mantis ID: 15727
- Version: 2.4.0
- Fixed in version: 2.4.2
- Fixed in revision: 15201 (#78e19bdd)
- Target version: 2.4.2