[fpc-pascal]ReAlloc Question

James Mills prologic at prologitech.com
Sat May 17 02:32:23 CEST 2003


On Fri, May 16, 2003 at 04:29:17PM +0200, Michael Van Canneyt wrote:
> 
> 
> On Fri, 16 May 2003, James Mills wrote:
> 
> > On Fri, May 16, 2003 at 03:05:30PM +0200, Michael Van Canneyt wrote:
> > >
> > > > > I'll show you... Catch, datanicks.pas and nickclass.pas ...
> > > > > This is why I need to understand and fix this, it's not just a simple
> > > > > TStringList that I want to use :)
> > > >
> > > > Forgot to attach em :(
> > >
> > > It should work with this class too.
> >
> > Okay, thanks.
> >
> > btw ... Is this how you write classess properly ? (destroy destructor as
> > you said ...)
> >
> > type
> >    TTokenizer = class(TObject)
> >       constructor init(tmpStr: String);
> >       constructor init(tmpStr: String; tmpDelim: Char);
> >       destructor destroy; override;
> >
> > .
> > .
> > .
> >
> > destructor TTokenizer.destroy;
> > begin
> >    inherited destroy;
> > end;
> 
> This is OK. It's also customary to call the constructor 'Create'. It
> reflects more what is happening, namely that *new* memory is allocated.
> 'Init' reflects more that *existing* memory is initialized.
> (which is more an old TP construct)

Okay. Thank you :)

James

> 
> Michael.
> 
> 
> _______________________________________________
> 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