SRL Archive - OSR Help

error in script


JuKKa

2010-10-13 14:40:07

im having a error i cannot find out what the problems seems to be. Been looking for a while debugging etc cant get it to compile.

Function getAnswer(Var Chats: TStringArray; Var Index: Integer; Var Answer: String): Boolean;
Var
I, R, C: Integer;
Begin
For I := 8 DownTo 1 Do //error highlights this line
For R := 0 To High(Responds) Do
For C := 0 To High(Responds[R].Text) Do
If(InStrArr(Responds[R].Text[C], Chats[I], False))Then
Begin
Result := True;
Answer := Responds[R].Answer[Random(High(Responds[R].Answer))];
Index := I;
Exit;
End;

End;

error:
[Error] C:\Simba\Includes\SRL/SRL/core/cautorespond.scar(53:59): Type mismatch at line 52

Dynamite

2010-10-13 14:48:19

Take out that line, what does it say?

JuKKa

2010-10-13 14:50:53

like i said I have been debugging

but here: Type mismatch at line 51

Wizzup?

2010-10-13 14:51:59

Do you have all the code? It would help to know at least the types of the other variables you use. (And what line 52 is, we can't tell it without the other code)

JuKKa

2010-10-13 15:32:51

There was some odd bug Im not rly sure what it was i just rewrote the whole function its now working, ty thought