[fpc-pascal] Freepascal and good usage of TStringList

Mariano mariano at pymesoft.com.ar
Mon Jul 25 20:11:18 CEST 2005


Well... :-P i'm not good too... but i think that the problems is:

List0 and List1 are pointers to an TStringList Object...
so, the right sentence must be:

List0 := TStringList.Create;
List1 := TStringList.create;

intead

List0.create;
List1.create;

".Create" are a class method that give a pointer to the created object...

And the same for free them:

List0.Free;
List1.Free;

intead

List0.Destroy;
List1.Destroy;

:-) 

Other issues:

* The Result of the function "CleanList" is never assigned!
* As Parameter... change:
procedure My_Proc(var SL :TstringList);
to
procedure My_Proc(Const SL :TstringList);

:-) hope that this can help you! :-P




More information about the fpc-pascal mailing list