[fpc-pascal] Freepascal and good usage of TStringList
Jean-Marc Chourot
jeanmarc.chourot at free.fr
Mon Jul 25 20:44:42 CEST 2005
dear Mariano,
OH.. many thanks... How stupid I was !
I feel better now !
JM
-----Message d'origine-----
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org]De la part de Mariano
Envoyé : lundi 25 juillet 2005 20:11
À : 'FPC-Pascal users discussions'
Objet : RE: [fpc-pascal] Freepascal and good usage of TStringList
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
_______________________________________________
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list