You need to do something like:
result := TStringList.Create;
result.Add(a);
result.Add(b);
result.Add(c);
but the tstringlist has to be free]d at some stage.
You could do:
procedure MyFunction(a, b, c: String; PList: TStrings);
begin
PList.Add(a);
PList.Add(b);
Plist.Add(c);
end;
and call it:
MyFunction(a, b, c, Stringlist);
> -----Original Message-----
> From: Luke Pascoe [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 5 April 2000 11:59 a.m.
> To: Multiple recipients of list delphi
> Subject: [DUG]: function which returns an object
>
>
> How do I write a library function which returns a TStringList object?
>
> To be used like:
>
> function MyFunction(a, b, c: String): TStringlist;
> begin
> ...
>
> ...
> StringList.AddStrings(MyFunction(a, b, c));
> ...
>
> --
>
> Luke Pascoe
> Programming
> Ihug
> [EMAIL PROTECTED]
> 0800 GET IHUG ext.9764
>
> "Get 'em by the balls and their hearts and minds will follow."
> --
>
>
> --------------------------------------------------------------
> -------------
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz