Can't set an TmenuItem.onclick event in property editor. lazarus / 10-Designer ---------------------------------------------------------------------- Andyk · 2012-06-12 12:17 When I try and set this, the IDE tries to do a syntax check of the whole project and fails on a new unit I have added which uses advanced delphi style records with operator overloading. It tells me I have to fix this error first even though there is no error in the unit, fpc is happy to compile the unit and it runs OK. Editor is v0.9.30.4 and fpc version 2.6.0 It seems the IDE syntax checker is not compatible with the fpc version being used. This is the code it fails on Quoteunit MComplex; {$mode delphi} interface uses SysUtils,math; type   Tcomplex=record       r,i:double;     public       function str:string;       class operator Implicit(const AValue: Double): TComplex;       class operator Implicit(const AValue: Integer): TComplex;       class operator Implicit(const AValue: Int64): TComplex;       class operator Add(const Left, Right: TComplex): TComplex;       class operator Subtract(const Left, Right: TComplex): TComplex;       class operator Multiply(const Left, Right: TComplex): TComplex;       class operator Divide(const Left, Right: TComplex): TComplex;       class operator Negative(const AValue: TComplex): TComplex;       class operator Equal(const Left, Right: TComplex): Boolean;       class operator NotEqual(const Left, Right: TComplex): Boolean;    end; It doesn't understand the first "function" after "public" says ":" expected. Any workarounds ? ---------------------------------------------------------------------- Andyk · 2012-06-12 20:11 The file also fails the tools/quick syntax check. This looks like an IDE bug and the codetools syntax checker is not compatible with fpc. Can anyone verify this, I can't continue on with my project because it won't let me set any component event properties. This is seriously affecting me. Is there any way to turn the syntax checker off? ---------------------------------------------------------------------- joseme · 2012-06-12 20:53 If I try to compile your unit, it fails but the error is not the same. The first message lines are: unit1.pas(13,16) Error: Forward declaration not solved "procedure str:AnsiString;" unit1.pas(14,22) Error: Forward declaration not solved "operator :=(const Double):;" unit1.pas(15,22) Error: Forward declaration not solved "operator :=(const LongInt):;" unit1.pas(16,22) Error: Forward declaration not solved "operator :=(const Int64):;" unit1.pas(17,22) Error: Forward declaration not solved "operator +(const Tcomplex;const Tcomplex):;" unit1.pas(18,22) Error: Forward declaration not solved "operator -(const Tcomplex;const Tcomplex):;" ... I am using Lazarus 1.1 Revision 37429, FPC 2.7.1 ---------------------------------------------------------------------- Andyk · 2012-06-12 21:12 Yeah, I only included the header part of the file in the post, the FPC compiler has no problem with it, its a complex math unit I developed in Delphi, the program compiles and runs OK under lazarus. The problem is I can't now add any more visual components on a form because the IDE syntax checker throws up an error in the code as detailed in the first post. It looks like the IDE uses its own syntax checker/parser which it runs before it will allow any event properties to be added to components and it doesn't understand the advanced record structure. ---------------------------------------------------------------------- Andyk · 2012-06-13 10:23 I downloaded and, after much pain, managed to installed the 1.1 snapshot. It seems this is fixed in Laz 1.1. ---------------------------------------------------------------------- joseme · 2012-06-13 11:14 Glad to know that. Because I am very lazy, I adopted CodeTyphon several months ago.