uses System.SysUtils;
type
TPoint = record
X, Y: Integer;
end;
//no tuple matching in case:
//explicit checks in order
function Describe(const P: TPoint): string;
begin
if (P.X = 0) and (P.Y = 0) then
Result := '(0, 0) point'
else if P.Y = 1 then
Result := Format('(%d, 1) point', [P.X])
else if P.X = 1 then
Result := Format('(1, %d) point', [P.Y])
else if P.X = P.Y then
Result := Format('(%d, %d) point',
[P.X, P.Y])
else
Result := 'other point';
end;
var
Point: TPoint;
begin
Point.X := 5;
Point.Y := 5;
WriteLn('str is ', Describe(Point));
//str is (5, 5) point
end.