I'm using Delphi XE4 and SuperObject 1.24
I Have the following structure :
type
TMyArray = Array of Array of Variant;
TMyRecord = Record
Values : TMyArray;
end;
var
T,W : TMyRecord;
S : String;
i : integer;
begin
SetLength(T.Values, 2 );
for i := 0 to 1 do
SetLEngth(T.Values[i],2);
T.Values[0,0] := 'Hello World';
T.Values[0,1] := 'Foo';
T.Values[1,0] := 'Bar';
T.Values[1,1] := 'is here';
R := TSuperRttiContext.Create;
S := R.AsJson<TMyRecord>(T).AsString;
W := R.AsType<TMyRecord>( SO(S) );
R.Free;
end;
S Contains {"Values":[["Hello World","Foo"],["Bar","is here"]]}
which seems to be correct
W displays (((Delphi exception EVariantBadVarTypeError at $294AD325, Variant array of Unknown), (Variant array of Unknown, Variant array of Unknown)))
How can I recreate a multidimensional array correctly?