[fpc-pascal] Re: variables in class, class variables and fields

Sven Barth pascaldragon at googlemail.com
Sat Nov 6 16:11:36 CET 2010


On 06.11.2010 15:39, ik wrote:
> But why class variables and not class fields ?

As I personally think about normal class fields as "variables per class 
instance", I see no difference between calling something "class field" 
or "class variable".

If it is the "var" keyword you are stumbling on, then let me tell you 
that normal fields can also be started with "var" (which is needed when 
you defined class types or constants before that).

E.g. (compiled with 2.5.1):

   TTest = class
   private
     const
       Foo = 42;
     var
       fTestField: Integer;
   public
     property TestField: Integer read fTestField;
   end;

Regards,
Sven



More information about the fpc-pascal mailing list