SRL Archive - Help

Error: Out of Proc Range at


slushpuppy

2013-01-04 21:25:19

type
RW_TState = (RW_TNext,RW_TCurrent,RW_TNoop);
RW_TStateFunc = function (walkPoint : TPoint) : RW_TState;
RW_TColorFunc = function (var tpa : TPointArray;color,tol : Integer; box : TBox; optional : TVariantArray) : Boolean;
RW_TPoint = Record
colorFinder : RW_TColorFunc;
direction : extended;
till,before : RW_TStateFunc;
color,tolerance : Integer;
end;

....





function RW_IsPathOnMM(pt : RW_TPoint;var walkTo : TPoint; var tpa : TPointArray) : Boolean;
...
begin
Result := false;

if pt.colorFinder(tpa,pt.color,pt.tolerance,IntToBox(MMX1 - 5,MMY1 - 5,MMX2 - 5,MMY2 - 5),['']) then //Error: Out of Proc Range at line 243
begin

...

I can assure you that color and tol are set.

Sin

2013-01-04 21:28:42

Im not sure what you're asking, mind saying which line it errors on?
Oh, and Results are on default set to false (0), so you don't need to do Result := False :d

slushpuppy

2013-01-04 21:43:26

From: Shay
Im not sure what you're asking, mind saying which line it errors on?
Oh, and Results are on default set to false (0), so you don't need to do Result := False :d


if pt.colorFinder(tpa,pt.color,pt.tolerance,IntToBox(MMX1 - 5,MMY1 - 5,MMX2 - 5,MMY2 - 5),['']) then //Error: Out of Proc Range at line 243

slushpuppy

2013-01-04 21:51:00

:duh: turns out I did not assign a function ref to pt.colorFinder

The error message was quite misleading xD