Procedure Tform1.btn1click (Sender:tobject);
Var
Jo:isuperobject;
temp:string;
Temp1:boolean;
Begin
Jo:=so (Mmo1. Text);
ShowMessage (Jo. Asjson (false,true));
temp:=jo[' name ']. asstring;
ShowMessage (temp);
temp:= jo[' sex ']. asstring; Jo[] The size of the string in the case of consistent inconsistency will be error, such as sex will be an error
ShowMessage (temp);
temp:=jo[' weight '. asstring;
ShowMessage (temp);
temp:=jo[' addresses '. asstring;
ShowMessage (temp);
ShowMessage (jo[' Tel '). asstring);
ShowMessage (jo[' children '). asstring);
End
Memo.text
{
"Name": "Zhang San",/* Comment */
"Age": 33,
"Sex": true,
"Weight": 123.456,
"Tel": ["86-1111111", "86-2222222"],
"Addresses": {"Address": "A province b City", "PC": "100001"},
"Children": [
{
"Name": "Zhang Ji",
"Age": "22",
"Sex": True
},
{
"Name": "Zhangcheng",
"Age": "11",
"Sex": false
}
]
}
About Jo in JSON. [] The problem of string consistency