Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program new;
- type
- //TPoint = packed record x,y:Int32; end;
- //TPointArray = array of TPoint;
- TShapeDesc = packed record
- HotPoints: TPointArray;
- ColdPoints: TPointArray;
- end;
- procedure TShapeDesc.FindInThingy(ptrn:TPointArray);
- var
- i:Int32;
- tmp:Double;
- test:TPointArray;
- begin
- for i:=0 to High(self.HotPoints) do
- begin
- test := Copy(ptrn); //I think this can (indirectly) be the cause
- WriteLn(HotPoints[i]); //but the crash is located here.
- end;
- end;
- //-------| TEST |-------------------------------------------------------------//
- var
- ShapeDesc: TShapeDesc;
- SearchPoints: TPointArray;
- begin
- 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]];
- ShapeDesc.HotPoints := [[87,60], [45,117], [124,140]];
- SearchPoints := [[180,96], [11,97], [131,101], [23,102], [124,140]];
- ShapeDesc.FindInThingy(searchPoints);
- end;
- //---------------------------------------------------------------
- (*
- procedure FindInThingy(self:TShapeDesc; ptrn:TPointArray);
- var
- i:Int32;
- tmp:Double;
- test:TPointArray;
- begin
- for i:=0 to High(self.HotPoints) do
- begin
- test := Copy(ptrn); //NO CRASH THIS TIME
- WriteLn(self.HotPoints[i]);
- end;
- end;
- begin
- ...
- FindInThingy(ShapeDesc,searchPoints);
- end;
- *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement