Class refuses to compile lazarus / 61-Beginners ---------------------------------------------------------------------- jcaser1948 · 2018-03-11 10:11 I try to recompile code written by CorpsmanDE for Delphi (pingPong) I work with Opensuse Linux and Lazarus 1.8.2 I get the following Errors elements.pas(32,24) Error: Duplicate identifier "Position" elements.pas(32,24) Hint: Identifier already defined in elements.pas at line 29 elements.pas(32,34) Error: Duplicate identifier "SpeedVektor"....etc Here is the code Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Unit Elements; Interface Uses  classes, LCLIntf, LCLType, LCLProc, // Trect  graphics; // TCanvas, TColor  Type  TBall = Class;   TFpoint = Record    x, y: Single;  End;    TBall = Class  private    fvx, fvy, fx, fy, fr, fm: Single;    fc: Tcolor;    Function getpos: Tfpoint;  Procedure Setpos(Value: TFpoint);    Function getSpeed: Tfpoint;    Procedure SetSpeed(Value: TFpoint);  public    Property Color: Tcolor read FC write fC;    Property Radius: Single read fr;    Property Position: Tfpoint read getpos write Setpos;    Property SpeedVektor: TFpoint read getSpeed write SetSpeed;    Property Mass: Single read Fm write fm;    Constructor Create(Position, SpeedVektor: TFpoint; Radius, Mass: single);    Destructor Destroy; override;    Procedure Render(Const Canvas: TCanvas);    Procedure CalculateMass;    Procedure BorderCollision(CollisionRect: Trect; InsideCollision: Boolean = True);    Procedure CollideWithOther(Const Ball2: TBall);  Procedure Move;  End;  Function Point(x, y: Single): Tfpoint;Function Rect(ALeft, ATop, ARight, ABottom: Integer): Trect; Implementation         Why does the class not compile? What did I wrong?Iassume it compiled in delphi Thans for the help ---------------------------------------------------------------------- marcov · 2018-03-11 10:18 Quote from: jcaser1948 on March 11, 2018, 11:11:22 amI try to recompile code written by CorpsmanDE for Delphi (pingPong) To compile delphi code, enable Delphi mode in compiler options, or pass -Sd on the commandline. (or put {$mode delphi} in code). The default is FPC's slightly deviating objfpc dialect ---------------------------------------------------------------------- Bart · 2018-03-11 10:18 Add {$Mode Delphi} (directly below the unit declaration). Default compiler mode does not allow the uses af a method parameter that has the same name as an already declared identifier. Alternatively rename the parameters: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   Constructor Create(APosition, ASpeedVektor: TFpoint; ARadius, Mass: single); Bart [Edit] Marcov beat me by 15 seconds ---------------------------------------------------------------------- jcaser1948 · 2018-03-11 12:02 Thanks, it works both ways