About Jo in JSON. [] The problem of string consistency

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.