[fpc-pascal] fpreport rangeerrors with TFPReportColor
Michael Van Canneyt
michael at freepascal.org
Wed Feb 21 23:53:32 CET 2018
On Wed, 21 Feb 2018, Mattias Gaertner wrote:
> On Wed, 21 Feb 2018 19:54:55 +0000
> Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:
>
>> [...]
>> > Because UInt32 is not a JSON dataformat.
>>
>> Well, then I'll say that FPC's JSON needs to be extended to support
>> UInt32, as it is a perfectly valid Object Pascal data type.
>
> How should FPC's JSON support something, that is not supported by
> JSON?
The problem is not in JSON.
Native Javascript supports 2^52 (or so) integer values, so every UInt32 value should fit
if written properly.
FPC's JSON supports Int64 and even QWord in FPC, so a UInt32 is definitely supported.
If the colors (a UInt32) is currently written as Longint (signed 32-bit)
then of course a range check will follow, and this needs to be fixed.
The easiest solution is simply to read/write it as Int64.
Michael.
More information about the fpc-pascal
mailing list