Re: Faster way of making long string?
- From: erewhon@xxxxxxxxxx (J French)
- Date: Sun, 24 Apr 2005 13:07:22 +0000 (UTC)
This is just delegating the inefficiency to TStringList
On Sun, 24 Apr 2005 13:06:51 +0200, Ekkehard Domning <edo@xxxxxxxx>
wrote:
>Hello Ian,
>
>Ian Hinson wrote:
> > I want to make a string of numbers from an integer list.
>
>how do You like this?
>
>var
> i: integer;
> lstNumbers: TIntegerList;
> strOut: string;
> sl : TStringList;
>begin
> strOut := '';
> sl := TStringList.Create;
> try
> for i := 0 to lstNumbers.Count-1 do
> sl.Add(IntToStr(lstNumbers[i]);
> strOut := sl.CommaText;
> finally
> sl.Free;
> end;
>end;
>
>All NumberStrings are placed in List, strOut is composed from the list
>strings, list is freed after usage. Should be faster.
>SetLength would be nice, but than You have to call IntToStr twice for each
>entry, first to get the length, second to get the string.
>
>> Thanks,
>> Ian.
>
>Best regards
>Ekkehard Domning
.
- Follow-Ups:
- Re: Faster way of making long string?
- From: Ekkehard Domning
- Re: Faster way of making long string?
- References:
- Faster way of making long string?
- From: Ian Hinson
- Re: Faster way of making long string?
- From: Ekkehard Domning
- Faster way of making long string?
- Prev by Date: Re: Faster way of making long string?
- Next by Date: Inactive shutdown service
- Previous by thread: Re: Faster way of making long string?
- Next by thread: Re: Faster way of making long string?
- Index(es):
Relevant Pages
|