I am trying to create a custom record to store location of a point in 2d space.
The following code fails to compile:
type
TVertex = record
x: Single;
y: Single;
public
procedure Assign(x_val, y_val: Single); // Fatal: Syntax error, ":" expected but "PROCEDURE" found
end;
The definition of TVertex follows the same structure as the TPoint record declaration.
TPoint = packed record
x : Longint; y : Longint;
public
constructor Create(ax,ay:Longint); overload;
end;
What am I doing wrong here?