Jo, 'arry, bb: ISuperObject;
StrSQL, sResult, STMP: string;
SZTBH: string;
Arry1: TSuperArray;
The begin
STMP:='{" GQCPBH ": [{" CPBH" : "0101"}, {" CPBH ":" 0602 "}], "resmsg" : "data query success", "resid" : "0"} ";
Jo: SO=(STMP);
Bb:=SO (' {eee: seee, ooo: st} ');
Jo: [' a ']=SA ([]);
Jo. A [' A ']. Add (bb);
Jo. A [' A ']. Add (so (' {} then, '));
Memo1. Lines. The Add (Jo. AsJSon (true, true));
In theory:
{
"A" :
{
"Eee" : "seee,"
"Ooo" : "st"
},
{
"11" : 33
}
],
"GQCPBH" : [
{
"CPBH" : "0101"
},
{
"CPBH" : "0602"
}
],
"Resid" : "0",
Data query "resmsg" "success"
}
Actual it is concluded that:
{
"GQCPBH" :
{
"CPBH" : "0101"
},
{
"CPBH" : "0602"
},
"A" :
{
"Ooo" : "st",
"Eee" : "seee
"},
{
"11" : 33
},
"Resmsg: \ u6570 \ u636e \ u67e5 \ u8be2 \ u6210 \ u529f",
"Resid" : "0"
}
Question:
1. The array brackets are not;
2. Chinese into coding;
Please explain how to write to get theoretical results?
CodePudding user response:
Note: I use the SuperObject version for V1.5CodePudding user response:
Use your code to test no problem, but my SuperObject is 1.2, D7 high version,The code to AsJSon the second parameter is set to False,
CodePudding user response:
Delphi high version of the built-in JSON library, can tryCodePudding user response: