Board index » delphi » using TstringLists in user defined objects
Olivier
![]() Delphi Developer |
Olivier
![]() Delphi Developer |
using TstringLists in user defined objects2004-05-24 08:11:53 AM delphi148 I try using a TStringlist as an object's attribute But the "Create" doesn't work and i don't know where is the problem voila le bout de code qui plante: ... Groupe_mots = class(TPersistent) private {liste de chaine} liste_mots : TStrings; public {le constructeur par défaut} constructor Create;overload; ... constructor Groupe_mots.create; Begin inherited Create; liste_mots := TstringList.Create;{the problem is here} End; ... olivier -- Using Opera's revolutionary e-mail client: www.opera.com/m2/ |
Avatar Zondertau
![]() Delphi Developer |
2004-05-24 02:29:25 PM
Re:using TstringLists in user defined objectsQuoteI try using a TStringlist as an object's attribute constructor? Do you have any other constructors? If you have other constructors of which all parameters have default values Delphi may not know which one to call. |
Olivier
![]() Delphi Developer |
2004-05-24 06:25:53 PM
Re:using TstringLists in user defined objects
On 23 May 2004 23:29:25 -0700, Avatar Zondertau
<XXXX@XXXXX.COM>writes: Quote>I try using a TStringlist as an object's attribute the execution error message is like this "EaccesViolation with the message "acces violation at the adress xxx in the module 'project.exe'"..." thanks for your answer -- Using Opera's revolutionary e-mail client: www.opera.com/m2/ |
Avatar Zondertau
![]() Delphi Developer |
2004-05-24 11:43:00 PM
Re:using TstringLists in user defined objectsQuoteyes, i have another constructor but without default parameter seperately. |
Olivier
![]() Delphi Developer |
2004-05-25 12:30:29 AM
Re:using TstringLists in user defined objectsQuoteThis error is not caused by the code you posted. Please post more of myinst.Create instead of myinst : myobject; myinst := myobject.Create; -- Using Opera's revolutionary e-mail client: www.opera.com/m2/ |