#1 2023-02-08 11:03:21

senad
Member
Registered: 2023-02-08
Posts: 5

DynArrayLoadJSON mormot1 vs mormot2

Hi,
why is null as double in mormot2 not excepted?
this code works fine in mormot1.

procedure TForm1.Button1Click(Sender: TObject);
type
  TTestRec = packed record
    a: Integer;
    b: Double;
    c: RawUTF8;
  end;
  TTestRecDynArray = array of TTestRec;
var
  hTmpBuff: TSynTempBuffer;
  hArr: TTestRecDynArray;
begin
  hTmpBuff.Init('[{"a":0,"b":null,"c":"abc"}]');
  if (DynArrayLoadJSON(hArr, hTmpBuff.buf, TypeInfo(TTestRecDynArray)) = nil) then
    ShowMessage('error');
  hTmpBuff.Done;
end;

Offline

#2 2023-02-08 19:16:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: DynArrayLoadJSON mormot1 vs mormot2

Offline

#3 2023-02-09 12:45:33

senad
Member
Registered: 2023-02-08
Posts: 5

Re: DynArrayLoadJSON mormot1 vs mormot2

thx, now it works

Offline

Board footer

Powered by FluxBB