![]() ![]() I'm pretty stuck on how to do it in Delphi (besides creating JSON by hand via string concatenation). But if I pass an array of TReplaceField, it gives me a compile error: E2010 Incompatible types: 'TObject' and 'Dynamic array' When I use a TList at runtime, I get a different error: type tkPointer is not currently supported In C#, all of this is pretty easy, like a few lines of code. I've found REST.JSON and TJson.ObjectToJsonString, which works good for 1 object. I want to create a collection of it, be it an array, TList, or whatever suits best in this case, and then serialize it to JSON (to store it) and later deserialze it to loop over the fields. I have a unit with the following class declaration: TReplaceField = class public Key: string Value: string constructor Create overload constructor Create(strKey, strValue: string) overload end Class can also be record, like suggested in the comment.
0 Comments
Leave a Reply. |