opensubscriber
   Find in this group all groups
 
Unknown more information…

f : fpc-pascal@lists.freepascal.org 31 July 2012 • 8:56PM -0400

Re: [fpc-pascal] Initialization of class field
by michael.vancanneyt

REPLY TO AUTHOR
 
REPLY TO GROUP






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@list...
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.