Recent

Author Topic: array of array of TPoint  (Read 668 times)

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 361
array of array of TPoint
« on: March 10, 2024, 09:21:42 pm »
What is that I don't see. Does not work.

Code: Pascal  [Select][+][-]
  1.  
  2. var
  3.  
  4.    Points_Polybezier: array of array of TPoint;
  5.    P1: TPoint;
  6. begin
  7.  
  8.   setLength(Points_Polybezier, 0, 4);
  9.   P1 :=       Point(100,0);
  10.   Points_Polybezier[0][0].x :=  3;
  11.   Points_Polybezier[0][0].y :=  4;
  12.   Points_Polybezier[0][0] :=  P1;
  13.   Points_Polybezier[0][1] :=  Point(100,0);
  14.   Points_Polybezier[0][2] :=  Point(100,0);
  15.   Points_Polybezier[0][3] :=  Point(100,0);      
  16.  
lazarus 3.2-fpc-3.2.2-win32/win64

Fibonacci

  • Hero Member
  • *****
  • Posts: 788
  • Internal Error Hunter
Re: array of array of TPoint
« Reply #1 on: March 10, 2024, 09:23:22 pm »
SetLength to 0 might be a problem, change it to 1.

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 361
Re: array of array of TPoint
« Reply #2 on: March 10, 2024, 09:24:35 pm »
That was fast. Thanks.
lazarus 3.2-fpc-3.2.2-win32/win64

Thaddy

  • Hero Member
  • *****
  • Posts: 18516
  • Here stood a man who saw the Elbe and jumped it.
Re: array of array of TPoint
« Reply #3 on: March 10, 2024, 09:26:01 pm »
Then 4 may be a problem too. Set it to 5  :P
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

PawelO

  • New Member
  • *
  • Posts: 28
    • Polish railway traffic and interlocking simulator developed with Lazarus
Re: array of array of TPoint
« Reply #4 on: March 11, 2024, 01:28:20 am »
Indexes 0 to 3 are used, so length 4 is ok.

 

TinyPortal © 2005-2018