Janilabo

TPAToStr

Jul 13th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.52 KB | None | 0 0
  1. function TPAToStr(TPA: TPointArray): string;
  2. var
  3.   h, i: Integer;
  4. begin
  5.   Result := '[';
  6.   h := High(TPA);
  7.   if (h > -1) then
  8.   begin
  9.     for i := 0 to (h - 1) do
  10.       Result := (Result + '(' + IntToStr(TPA[i].X) + ', ' + IntToStr(TPA[i].Y) + '), ');
  11.     Result := (Result + '(' + IntToStr(TPA[i].X) + ', ' + IntToStr(TPA[i].Y) + ')');
  12.   end;
  13.   Result := (Result + ']');
  14. end;
  15.  
  16. var
  17.   TPA: TPointArray;
  18.  
  19. begin
  20.   TPA := [Point(0, 1), Point(2, 3), Point(4, 5), Point(6, 7), Point(8, 9)];
  21.   WriteLn(TPAToStr(TPA));
  22. end.
Advertisement
Add Comment
Please, Sign In to add comment