[lazarus] Stange error message

Michael Van Canneyt michael.vancanneyt at wisa.be
Thu Jun 22 11:02:01 EDT 2000




On Thu, 22 Jun 2000, Robert Scott Horning wrote:

> Marc Weustink wrote:
> 
> > At 01:50 22-06-2000 +0200, Marc Weustink wrote:
> > >When compileing my new selection stuff I get the following error:
> > >
> > >controlselection.pp(140,1) Error: Symbol can't be published, can be only a
> > >class
> >
> > I found the error.
> >
> > In my implementation section I declared the following
> >
> > type
> >    TMyControl = class(TControl);
> >
> > const
> >    blah....
> >
> > constructor.... etc.... all implementation stuff
> >
> > Unlike Delphi, FPC doesn't like this, it wants an end statement after a
> > class. It should be declared as:
> >
> > type
> >    TMyControl = class(TControl)
> >    end;

No it does not. The following compiles fine:

unit testc;

interface

Type
  TMyClass = Class (Tobject);

Implementation

end.

If you look in sysutils, you will see many such declarations for exceptions.


> >
> > Marc
> 
> I'm kinda curious about this construct.  In Delphi, when you declare something
> like:
> 
> type
>    TMyControl = class(TControl);
> 
> this is a forward class reference, so you can use a reference to a class that
> hasn't been defined yet.

No, it is not. The above is a _complete_ class definition.

The following is a forward class reference:

  TMyControl = Class;
  
Michael.






More information about the Lazarus mailing list