Forum > Beginners

Fatal: Syntax error, "=" expected but "CONSTRUCTOR" found

(1/1)

Bill52:
Hi there,

The  below code produces the error:


--- Code: ---unit myClass;

{$mode objfpc}{$H+}


interface

type
   TmyClass = class(TObject);
   public
      constructor  Create;

end;

implementation

constructor TmyClass.Create;
begin
end;

end.   

--- End code ---

The error message:
myclass.pas(11,7) Fatal: Syntax error, "=" expected but "CONSTRUCTOR" found

Line 11 is highlighted: constructor  Create;

It's on Vista 32, Lazarus 1.2.4; fpc 2.6.4

I can't see what's wrong.
Thanks!

Blaazen:
Remove the semicolon:

--- Code: ---   TmyClass = class(TObject)
--- End code ---

Bill52:

--- Quote from: Blaazen on August 24, 2014, 11:02:52 am ---Remove the semicolon:

--- Code: ---   TmyClass = class(TObject)
--- End code ---

--- End quote ---

DOH! Just couldn't see it.
Thanks!

Navigation

[0] Message Index

Go to full version