> C) Just out of curiosity, am wondering why FreeAndNil is global procedure
> instead of a method/destructor of TObject.   I am guessing it is
> for compatibility with Delphi which may or may not have a reason?

A method could not act the way FreeAndNil works (zeroing a local
pointer variable). It could be a static/class method, but this would
just add noise to the code.
BTW FreeAndNil can only on TObject and descendants.

-Flávio
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to