Link to home
Start Free TrialLog in
Avatar of odissey1
odissey1

asked on

How initialaize TPoint array: Poly: array [0..2] of TPoint = ( (1,1), (2,2), (3,3) ); //not compile

Hi Experts,

how to initialize a TPoint Array, like:
   Poly: array [0..2] of TPoint = ( (1,1), (2,2), (3,3) ); //this won't compile

Sincerely,
odissey1
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,
  something like this will do the work (workaround).

procedure TForm1.Button1Click(Sender: TObject);
const
 v: array [0..2, 0..1] of Integer = ((1, 2), (1, 1), (1, 1));
var
 p: array [0..2] of TPoint;
 i: Integer;
begin
 for i := low(p) to high(p) do
  p[i] := Point(v[i][0], v[i][1]);
end;