Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   TJson.Format und TJSONAncestor.Format (https://www.delphipraxis.net/199899-tjson-format-und-tjsonancestor-format.html)

Edelfix 28. Feb 2019 14:21

TJson.Format und TJSONAncestor.Format
 
Hallo,

irgendwie komme ich hier nicht weiter. Wie wende ich das neue TJSONAncestor.Format an?

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  jsRequestObj: TJSONObject;
  sJsonString: string;
begin
  sJsonString := '{"allowOnlyShift": false,"stay": {"checkIn": "2019-10-01", "checkOut": "2019-10-02"}, "occupancies": [{"rooms": "1","adults": "2","children": "0"}],"destination": {"code": "NYC"}}';
  jsRequestObj  := TJSONObject.ParseJSONValue(sJsonString) as TJSONObject;
  Memo1.Lines.Add(TJson.Format(jsRequestObj));
  //Memo1.Lines.Add(TJsonAncestor.Format(jsRequestObj)); // So geht es nicht!!!
end;

mjustin 28. Feb 2019 14:35

AW: TJson.Format und TJSONAncestor.Format
 
Vermutlich so:
Delphi-Quellcode:
Memo1.Lines.Add(jsRequestObj.Format);

http://docwiki.embarcadero.com/Libra...ncestor.Format

Edelfix 28. Feb 2019 14:48

AW: TJson.Format und TJSONAncestor.Format
 
Danke,

habe es herausgefunden. War ganz einfach.

Delphi-Quellcode:
Memo1.Lines.Add(jsRequestObj.Format);


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:36 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz