[fpc-pascal] TStringList.SetCommaText needs refactor
Michael Van Canneyt
michael at freepascal.org
Sat Nov 9 18:20:12 CET 2019
Please create bugreports.
Michael.
On Sat, 9 Nov 2019, AlexeyT via fpc-pascal wrote:
> It's obvious this needs to use SetDelimetedText with other params (2nd 3rd)
>
> Procedure TStrings.SetCommaText(const Value: string);
> begin
> CheckSpecialChars;
> C1:=Delimiter;
> C2:=QuoteChar;
> Delimiter:=',';
> QuoteChar:='"';
> Try
> SetDelimitedText(Value);
> Finally
> Delimiter:=C1;
> QuoteChar:=C2;
> end;
> end;
>
>
> it's obvious this needs to be changed too:
>
> procedure TStrings.AddCommaText(const S: String);
> var
> L: TStringList;
> begin
> L := TStringList.Create;
> try
> L.CommaText := S;
> AddStrings(L);
> finally
> L.Free;
> end;
> end;
>
>
> --
> Regards,
> Alexey
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
More information about the fpc-pascal
mailing list