>You can use either FillChar as you did or use "Self := Default(TTest);" (default is a compiler intrinsics that returns a 0 value of the type >you passed in, e.g. Nil for classes, '' for strings, 0 for ordinals and for records all fields are set to 0)

How can I make it so that I only do the Self := Default() once in the parent class constructor and don't have to repeat it in all its descendant class constructor.


I noticed in your example, you have to specify the class name TTest but that implies in every descendant class, I have to replace it with the Descendant class name.

Can I do
  self := Default(ClassType) ?
hoping it will return the descendant's class type?

Dennis





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

Reply via email to