You are not logged in.
Pages: 1
Hi,
I converted this rawutf8 dyn array :
['A'
'B'
''
'C'
'']
to csv with RawUTF8ArrayToCSV, obtaining A,B,,C, as result.
When I call CSVToRawUtf8DynArray , then returned array ignores the blanks element of the array and returns
['A'
'B'
'C']
I have modified the function in Syncommons , excluding the control on s>''. Now it seems to work well, returning the original array;
procedure CSVToRawUTF8DynArray(CSV: PUTF8Char; var Result: TRawUTF8DynArray;
Sep: AnsiChar; TrimItems: boolean);
var s: RawUTF8;
begin
while CSV<>nil do begin
s := GetNextItem(CSV,Sep);
if TrimItems then
s := trim(s);
//if s<>'' then begin
SetLength(Result,length(Result)+1);
Result[high(Result)] := s;
//end;
end;
end;
Offline
But you broke the existing functionality... so will break existing code on production, which may expect this behavior.
Please check https://synopse.info/fossil/info/2757734c95
Offline
Ok,
I've modified as you suggested.
Tx very much
Offline
Pages: 1