You are not logged in.
Ab, have you seen this?
If I try to serialize a array to Json with TDynArray.SaveToJson, Delphi 7 give me this compiler error:
TEspecieCategorias = packed record
EspecieID: Integer;
Categorias: TCategorias;
CT: Double;
CTR: Double;
end;
[...]
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TEspecieCategorias), __TEspecieCategorias);
[Error]: Type 'TEspecieCategorias' has no type info.
But if I add a string field, then Delphi will generate type info.
TEspecieCategorias = packed record
EspecieID: Integer;
Categorias: TCategorias;
CT: Double;
CTR: Double;
Dummy: string; // <--------- don't use for nothing
end;
[...]
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TEspecieCategorias), __TEspecieCategorias);
Then Delphi 7 will compile and everything will work. Very weird.
Question: The record type need to be packed?
Offline