On Tue, 31 Jul 2012, Krzysztof wrote:

Hi,

I'm reading about variable initialization
(http://www.freepascal.org/docs-html/ref/refse22.html) . Can I
initialize class field too? Like in Java:

type
 TMyClass = class
 private
   FSomeField: Integer = 123;
end;

I always initialize this in overrided constructor, but above example
is much faster.

Object Pascal currently does not support this, except maybe for static class
variables. The compiler people should confirm this.

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

Reply via email to