Advertisement
WarPie90

Lape - CRASH CRASH CRASH

Sep 25th, 2015
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.62 KB | None | 0 0
  1. program new;
  2.  
  3. type
  4.   //TPoint = packed record x,y:Int32; end;
  5.   //TPointArray = array of TPoint;
  6.  
  7.   TShapeDesc = packed record
  8.     HotPoints: TPointArray;
  9.     ColdPoints: TPointArray;
  10.   end;
  11.  
  12. procedure TShapeDesc.FindInThingy(ptrn:TPointArray);
  13. var
  14.   i:Int32;
  15.   tmp:Double;
  16.   test:TPointArray;
  17. begin
  18.   for i:=0 to High(self.HotPoints) do
  19.   begin
  20.     test := Copy(ptrn);                    //I think this can (indirectly) be the cause
  21.     WriteLn(HotPoints[i]);                 //but the crash is located here.
  22.   end;
  23. end;
  24.  
  25.  
  26. //-------| TEST |-------------------------------------------------------------//
  27.  
  28. var
  29.   ShapeDesc: TShapeDesc;
  30.   SearchPoints: TPointArray;
  31. begin
  32.   ShapeDesc.ColdPoints := [[47,8], [175,12], [170,22], [60,33], [13,34], [131,34], [86,44], [24,46], [164,60], [128,66], [42,67], [18,73], [58,74], [92,83], [115,83], [180,96], [11,97], [131,101], [23,102], [66,110], [27,115], [105,126], [149,127], [57,140], [148,148], [39,168], [116,171], [75,173], [169,173], [69,192]];
  33.  
  34.   ShapeDesc.HotPoints  := [[87,60], [45,117], [124,140]];
  35.  
  36.   SearchPoints := [[180,96], [11,97], [131,101], [23,102], [124,140]];
  37.  
  38.   ShapeDesc.FindInThingy(searchPoints);
  39. end;
  40.  
  41.  
  42.  
  43.  
  44.  
  45. //---------------------------------------------------------------
  46. (*
  47. procedure FindInThingy(self:TShapeDesc; ptrn:TPointArray);
  48. var
  49.   i:Int32;
  50.   tmp:Double;
  51.   test:TPointArray;
  52. begin
  53.   for i:=0 to High(self.HotPoints) do
  54.   begin
  55.     test := Copy(ptrn);                    //NO CRASH THIS TIME
  56.     WriteLn(self.HotPoints[i]);          
  57.   end;
  58. end;
  59.  
  60. begin
  61.   ...
  62.   FindInThingy(ShapeDesc,searchPoints);
  63. end;
  64. *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement