[fpc-pascal] What's wrong with this simple test program
Joost van der Sluis
joost at cnoc.nl
Fri Dec 19 21:53:43 CET 2014
On 12/19/2014 09:48 PM, Ralf Quint wrote:
> I have been trying to use tStringList in a larger project of mine, but
> this just keeps bombing out with a exception.
> I have been able to reproduce the problem with this very simple test
> program:
>
> program project1;
>
> USES Classes;
>
> Var T : tStringList;
> S : String;
> begin
> S := 'Test';
> T.Create;
> // T.Clear;
> T.Add (S);
> T.Free;
> end.
You're mixing old TP-style objects with classes.
T := TStringList.Create is the correct syntax.
Regards,
Joost.
More information about the fpc-pascal
mailing list