mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 21:48:01 +02:00

without virtual methods: they may initialise the instance (mantis #23667) git-svn-id: trunk@23976 -
27 lines
421 B
ObjectPascal
27 lines
421 B
ObjectPascal
{ %opt=-vw -Sew }
|
|
{ %norun }
|
|
|
|
{$mode objfpc}
|
|
{$modeswitch advancedrecords}
|
|
|
|
type
|
|
tpoint = record
|
|
x,y: longint;
|
|
function add(const aPoint:Tpoint):TPoint;
|
|
procedure setlocation(xx,yy: longint);
|
|
end;
|
|
|
|
procedure tpoint.setlocation(xx,yy: longint);
|
|
begin
|
|
x:=xx;
|
|
y:=yy;
|
|
end;
|
|
|
|
function TPoint.Add(const aPoint:Tpoint):TPoint;
|
|
begin
|
|
Result.SetLocation(self.x+aPoint.X, self.Y+aPoint.Y);
|
|
end;
|
|
|
|
begin
|
|
end.
|