Quote Originally Posted by JSoftware
Quote Originally Posted by arthurprs
Quote Originally Posted by Almindor
Quote Originally Posted by User137
...
operator +(v1, v2: TVector2d): TVector2d;
begin
Result.x := v1.x + v2.x;
Result.y := v1.y + v2.y;
end;
...
This work ?
You can tell me more about it ?
I don't think it would work in FPC IIRC.
This would afaik:
[pascal]
operator +(v1, v2: TVector2d) result: TVector2d;
begin
Result.x := v1.x + v2.x;
Result.y := v1.y + v2.y;
end;
[/pascal]

If you want it to compile and work in both fpc and turbodelphi then use the following:
{$IFDEF FPC}
operator +(v1, v2: TVector2d) result: TVector2d;
{$ELSE}
class operator TVector2d.add(v1, v2: TVector2d): TVector2d;
{$ENDIF}
begin

end;
I tried several ways to make it work,
please explain how make it with a Tpoint on Delphi

PS: i use BDS2006