How can I assign values to TJSONValue using Delphi XE4 unit Data.DBXJSON?

308 Views Asked by At

How can I assign values to TJSONValue using Delphi XE4 unit Data.DBXJSON

var JSONValue: TJSONValue;
    JSONString: TJSONString;

JSONString := TJSONString.Create('Name');
JSONValue := TJSONObject.ParseJSONValue('Jhon');

But JSONValue remains equal to nil

because I am making my JSON object in the following way

var lobj: TJSONObject;

lobj.AddPair('Nane', 'Jhon');

// but I want to use this version of AddPais
lobj.AddPair(const Str: TJSONString; const Val: TJSONValue):
0

There are 0 best solutions below