You are not logged in.
Pages: 1
There is a little bug when using TStrings (e.g. TStringList) in a TSQLRecord
The last entry in the StringList-Data will not restore in the Record:
// SQLite3Commons.pas
function JSONToObject(var ObjectInstance; From: PUTF8Char; var Valid: boolean): PUTF8Char;
...
oStrings: begin
...
'"': begin
result := From;
PropValue := GetJSONField(From,From,@wasString,@EndOfObject);
// After getting the last PropValue From is NIL
// unfortunately this causes an exit, and PropValue will not get into the StringList!
if (PropValue=nil) or (From=nil) or not wasString then
exit;
Str.Add(UTF8ToString(PropValue));
case EndOfObject of
']': break;
',': continue;
else exit;
Offline
The Error is still there ... here a Patch for this
@@ -17867,7 +17867,7 @@
'"': begin
result := From;
PropValue := GetJSONField(From,From,@wasString,@EndOfObject);
- if (PropValue=nil) or (From=nil) or not wasString then
+ if (PropValue=nil) {or (From=nil)} or not wasString then
exit;
Str.Add(UTF8ToString(PropValue));
case EndOfObject of
Offline
The TRawUTF8List process was correct about this last item, but TStrings was not!
Thanks for the report.
See http://synopse.info/fossil/info/3e56f6ef4d
I've also made it a bit faster (avoided one allocation at UTF8ToString call).
Offline
Pages: 1