Exception integer out of range - reading JSON

I am reading some JSON using WEBLib.JSON - a snippet of the JSON containing the pair that causes a problem ("FMax":1e50) is shown below:

"fInternalName": "MePR_HFOAgeA",
"fCV": 16.155,
"DefValue": 16.155,
"fMax": 1e+50,
"fMin": 0.00001,
"fTempDep": 1,
"fDefTempDep": 1
Reading progresses well until fMax. I have traced the problem into WEBLib.JSON in the procedure procedure TJSONNumber.SetStrValue(const Value: string);
Line 636 execute fine but line 639 FInt := StrToInt(Value) raises an exception because Value is indeed out of range for an integer... the problem is that it is intended to be a double.... I think that there needs to be some range checking before attempting StrToInt...

As the procedure stands it limits the range of double to the range of integer :frowning:

I read the same JSON with System.JSON and have no such problems. [I am using the same code conditionally defining WebLib.JSON or System.JSON depending on the target platform] .

Am I missing something elementary?


Thanks for reporting. We implemented a guard against this.
Next update will address this.

Thanks Bruno