You are not logged in.
Pages: 1
The problem in
function OneFieldValues(Table: TSQLRecordClass; const FieldName: RawUTF8;
const WhereClause: RawUTF8=''; const Separator: RawUTF8=','): RawUTF8; overload;
It returns '1'#0',3,4,5,8,1,14,15' instead of '1,3,4,5,8,1,14,15' if I request FieldName = 'ID' (2 symbol length).
for i := 0 to T.fRowCount-1 do begin // ignore fResults[0] i.e. field name
//Lens[i] := StrLen(T.fResults[i]); // not correct: fResults[0] is field name
Lens[i] := StrLen(T.fResults[i+1]); // <--- correct
inc(Len,Lens[i]+SepLen);
end;
Please fix.
Offline
Houps...
Please check https://synopse.info/fossil/info/28cbca75fd
Offline
I suspect it won't work.
I didn't notice any Inc(i) in the infinite loop:
i := 1;
repeat
L := Lens[i-1];
if L<>0 then begin
{$ifdef FPC}Move{$else}MoveFast{$endif}(T.fResults[i]^,P^,L);
inc(P,L);
end;
if i=T.fRowCount then
break;
{$ifdef FPC}Move{$else}MoveFast{$endif}(pointer(Separator)^,P^,SepLen);
inc(P,SepLen);
until false;
Offline
Please check https://synopse.info/fossil/info/8e6401ca03
Offline
Ok. Thanks.
Offline
Pages: 1