On Fri, 12 Oct 2007 22:58:46 +0200
Vincent Snijders <[EMAIL PROTECTED]> wrote:

> Marc Santhoff schreef:
> > Hi,
> > 
> > the reference manual is not explicitly clear in describing class
> > declarations. Is it true for classes as for objects that the first
> > block of components after the class header are visible as if
> > declared public?
> > 
> > E.g.
> > 
> > TAnyClass = class
> >     fField:anytype;
> > end;
> > 
> > would make fField visible "public"?
> 
> It would be "published".

Classes with RTTI information use published, otherwise public.
See the {$M+} switch, for example TPersistent.


> > 
> > And one other question:
> > Does object pascal allow a class declaration marked as an abstract
> > class? Like in java for making sure the class can never be
> > instantiated itself, only it's descendants can be?
> > 
> > Smth. like:
> > 
> > TAnyClass = abstract class(...)
> >  ...
> > end;
> 
> 
> AFAIK, not.

No.
Just add abstract methods and you will get compiler warnings when
instantiating such a class.


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

Reply via email to