SRL Archive - Help and Support

[Runtime Error] : Could not call proc in line 245


Pancakes

2007-08-30 00:41:03

Strange error, no idea what to do with it.

procedure PickFlax;
var X, Y, I, J : Integer;
var FlaxFound : Boolean;
begin
for I := 0 to 20 do
begin

for J := 0 to GetArrayLength(FlaxColors) - 1 do //LINE 245!
begin
X := MSX2 / 2;
Y := MSY2 / 2;
if (FindColorSpiralTolerance(X, Y, FlaxColors[j], MSX1, MSY1, MSX2, MSY2, 3)) then
begin
MMouse(X, Y, 3, 3);
Wait(100 + Random(100));
if (IsUpText('lax')) then
begin
FlaxFound := True;
Break;
end;
end;
end;

if (FlaxFound) then Exit;
if (Not(FlaxFound)) then Compass(VK_LEFT);
end;
Mouse(X, Y, 3, 3, True);
end;

Daniel.Blaze

2007-08-30 04:47:26

maybe add something like this just incase it doesn't find any of the colors?


(If(getarraylength(FlaxColor) < 0)) then
Exit;

Sumilion

2007-08-30 04:59:54

How did you create FlaxColors and where do you fill it ?

mastaraymond

2007-08-30 05:26:33

From: Daniel.Blaze
maybe add something like this just incase it doesn't find any of the colors?


(If(getarraylength(FlaxColor) < 0)) then
Exit;


Nope, doesn't matter if the length is -1, then it doesn't execute the for loop ;).
try: For I:= 0 to -1 do
writeln('yeah');
Doesn't write anything, but it gets no error either.

Starblaster100

2007-08-30 05:37:02

maybe try putting

[php]
try
except
end;
[/php]

everywhere in the procedure and seeing if you can find the error like that

Daniel.Blaze

2007-08-30 06:51:40

From: mastaraymond
Nope, doesn't matter if the length is -1, then it doesn't execute the for loop ;).
try: For I:= 0 to -1 do
writeln('yeah');
Doesn't write anything, but it gets no error either.


:duh: didn't know that lol thanks

n3ss3s

2007-08-30 08:06:36

Yes, hunt down the real error line with try except, first put


try
TheErrorLineProc;
except
Writeln('Gotcha Bitch!');
end;

To the line it says the error is, if doesnt catch the bitch go one line up.

R0b0t1

2007-08-30 20:03:38

Lolz? ^

Is you calling before creating?

ZephyrsFury

2007-08-31 04:26:46

From: r0b0t1
Lolz? ^

Is you calling before creating?


If he called it before he created it he would get an unknown identifier error or something not the error he's getting now.

Santa_Clause

2007-08-31 05:25:52

Use Length instead of GetArrayLength.

ZephyrsFury

2007-08-31 05:41:53

From: SantaClause
Use Length instead of GetArrayLength.


Length is for the length of a string…. :rolleyes: ;)

Starblaster100

2007-08-31 05:46:26

Its for both

Santa_Clause

2007-08-31 05:53:50

From: Starblaster100
Its for both


Owned.

ZephyrsFury

2007-08-31 05:53:57

From: Starblaster100
Its for both


You can use Length for arrays? I thought it needed a string.

Starblaster100

2007-08-31 05:55:30

Its a new thing to SCAR divi.

Both GetArrayLength and Length can be used to get the length of an array

Santa_Clause

2007-08-31 06:00:01

Why is Length better though?

Starblaster100

2007-08-31 06:34:51

I don't know, I personally still use GetArrayLength :)

Infantry001

2007-08-31 23:05:25

wow im definitely using Length :D much shorter

mastaraymond

2007-09-01 05:25:42

From: SantaClause
Why is Length better though?

Length is 2 times slower then GetArrayLength… I tested it in a loop, so i switch back to GetArrayLength :).