Re: Faster way of making long string?



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

.



Relevant Pages

  • Re: Faster way of making long string?
    ... I tested of 3 different methods of making the number string. ... > Ian Hinson wrote: ... >> But I'm wondering whether this is an inefficient use of strOut. ...
    (alt.comp.lang.borland-delphi)
  • Re: Long filenames presented via Access DB do not work
    ... I changed the request ... string to include the computer and share name. ... I have an access database which ... > | Ian ...
    (microsoft.public.frontpage.programming)
  • Re: Faster way of making long string?
    ... But looking at the code in the Classes unit I found though that it uses the ... > Hello Ian, ... >> I want to make a string of numbers from an integer list. ... > All NumberStrings are placed in List, strOut is composed from the list ...
    (alt.comp.lang.borland-delphi)
  • Re: Faster way of making long string?
    ... > Hello Ian, ... > Ian Hinson wrote: ... >> I want to make a string of numbers from an integer list. ... > All NumberStrings are placed in List, strOut is composed from the list ...
    (alt.comp.lang.borland-delphi)
  • Re: vb6.exe closes randomly on W2000 Pro
    ... >>Ian wrote ... >>Public Function FileExists(strDest As String) As Boolean ...
    (microsoft.public.vb.winapi)