type
TPoint = record
X, Y: Integer;
constructor Create(AX, AY: Integer);
class operator GreaterThan(
const L, R: TPoint): Boolean;
class operator LessThan(
const L, R: TPoint): Boolean;
end;
constructor TPoint.Create(AX, AY: Integer);
begin
X := AX;
Y := AY;
end;
class operator TPoint.GreaterThan(
const L, R: TPoint): Boolean;
begin
Result := (L.X > R.X) and (L.Y > R.Y);
end;
class operator TPoint.LessThan(
const L, R: TPoint): Boolean;
begin
Result := (L.X < R.X) and (L.Y < R.Y);
end;
var
P1, P2: TPoint;
begin
P1 := TPoint.Create(1, 2);
P2 := TPoint.Create(2, 3);
WriteLn('b1 is ', P1 > P2);
//b1 is False
WriteLn('b2 is ', P1 < P2);
//b2 is True
end.