ReadOnly (TJSon)

De Wiki1000
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:





Whos here now:   Members 0   Guests 0   Bots & Crawlers 1
 
Outils personnels