Board index » delphi » TStrings

TStrings

What is the format for manually creating TStrings?  I am trying to create a
list of files to be used as a parameter for a file routine and the parameter
needs to be of type TStrings.

Right now I just put listbox on the form with the filenames and make it
invisible.  Then I just reference the listbox.items in the parameter.

Any insight is appreciated.

--
Doug Maurer
Innovative Software Solutions, Ltd.

 

Re:TStrings


Quote
Doug Maurer wrote:

> What is the format for manually creating TStrings?  I am trying to create a
> list of files to be used as a parameter for a file routine and the parameter
> needs to be of type TStrings.

> Right now I just put listbox on the form with the filenames and make it
> invisible.  Then I just reference the listbox.items in the parameter.

> Any insight is appreciated.

> --
> Doug Maurer
> Innovative Software Solutions, Ltd.

Never use the TStrings.Create method. Create it as a TStringList:

var
  YourList: TStrings;

  YourList:=TStringList.Create;

Sasan.

Re:TStrings


Thank you - that did the trick.  8-)

--
Doug Maurer
Innovative Software Solutions, Ltd.

Re:TStrings


//1) declare a TStrings variable:
v : TStrings;
//2)  Initialise variable v by:
v := TSringList(Create);

The syntax might not be exactly correct. I'm out of practice.

Quote
Doug Maurer wrote in message <1w6o2.2$X3....@news12.ispnews.com>...
>What is the format for manually creating TStrings?  I am trying to create a
>list of files to be used as a parameter for a file routine and the
parameter
>needs to be of type TStrings.

>Right now I just put listbox on the form with the filenames and make it
>invisible.  Then I just reference the listbox.items in the parameter.

>Any insight is appreciated.

>--
>Doug Maurer
>Innovative Software Solutions, Ltd.

Re:TStrings


Thank you for the help, everything is working awesome!

--
Doug Maurer
Innovative Software Solutions, Ltd.

Other Threads