ReadOnly (TJSon)
property ReadOnly:Boolean;
Cette propriété permet de contrôler la capacité à modifier le document.
Exemples:
//Procedure JsonParser;
var json:TJson; S,stag:string; idx:Integer;
begin
json := TJson.Create(
'{
"employees": [
{ "firstName":"John" , "lastName":"Doe" },
{ "firstName":"Anna" , "lastName":"Smith" },
{ "firstName":"Peter" , "lastName":"Jones" }
]
}'
);
// Be shure the document is not read only
json.ReadOnly := False;
// Now, we can modify the document
json.customers[0].code := CreateGUID;
...
end;
Voir aussi: