You are not logged in.
Hello folks,
Today I hit a wall, and hope some of you guys know a workaround...
I'm registering a bunch of Custom JSON Serializer for a types I need to convert from JSON to TObject using the following statement...
TTextWriter.RegisterCustomJSONSerializerFromText(TypeInfo(TMyClass), 'field1, field2, field3 RawUTF8').Options := [soReadIgnoreUnknownFields];
However, I've exceed the 255 string literal limit of the Delphi compiler for a medium size packed record.
How do you register a Custom JSON Serializer for a type with over 50 fields?
Thanks in advance for you help.
Regards,
Mario
Last edited by Mane (2021-03-11 23:20:56)
Offline
You can use a local variable, I guess.
Or... split the string, it's just a compiler limit
TTextWriter.RegisterCustomJSONSerializerFromText(
TypeInfo(TMyClass),
'field1, field2, ' + 'field3 RawUTF8'
).Options := [soReadIgnoreUnknownFields];
Offline
ab wrote:You can use a local variable, I guess.
Or... split the string, it's just a compiler limit
TTextWriter.RegisterCustomJSONSerializerFromText( TypeInfo(TMyClass), 'field1, field2, ' + 'field3 RawUTF8' ).Options := [soReadIgnoreUnknownFields];
Yes, I've not though about that, thank you!
Regards,
Mane
Offline