Saludos al foro
A los años que me acerco al Club del conocimiento.
Tengo un aplicativo hecho en Delphi XE y necesito implementar una rutina en JSON, para ello estoy utilizando la unit uLkJSON.
Mas logro llevar al CDS con las tildes
Código Delphi
[-]
[
,
]
procedure TForm24.Button1Click(Sender: TObject);
var
sJSON: string;
jl: TlkJSONlist;
ja: TlkJSONobject;
I: Integer;
begin
ClientDataSet1.Open;
ClientDataSet1.EmptyDataSet;
sJSON := Memo1.Lines.Text;
jl := TlkJSON.ParseText(sJSON) as TlkJSONlist;
for I := 0 to jl.Count - 1 do
begin
ja := jl.child[i] as TlkJSONobject;
ClientDataSet1.Insert;
ClientDataSet1id.AsString := ja.Field['id'].Value;
ClientDataSet1nombre.AsString := ja.getString('nombre');
ClientDataSet1edad.AsInteger := ja.Field['edad'].Value;
ClientDataSet1carnet.AsInteger := ja.Field['carnet'].Value;
ClientDataSet1.Post;
end;
end;
A la espera de su ayuda
Your friend
StartKill
Lima-Perú