Can't decide how to pass an handler
Posted: Sat Nov 15, 2014 10:24 am
Hi evrybody
i have one problem...
here is two handlers one is OpenCard and the other one is command checkIfwin
so i'm sending OpenCard to me every 1 seconds, but when verticalK is 5 (let's say you win) i want to pass checkIfwin handler, but after all that in openCard handler i get an error: no such handler(it is about checkIfwin). how to pass OpenCard too when verticalK is 5?
i hope i could explain my problem 

Code: Select all
global player1,player2,whoIs,check
on openCard
repeat with i=1 to 5
repeat with j=1 to 5
put the text of field("p"&i&j) into check[i][j]
end repeat
end repeat
checkIfwin
--send openCard to me in 1 secs
end openCard
command checkIfwin
put 1 into verticalK
repeat with i=1 to 5
repeat with j=1 to 5
if j<5 then
if check[i][j]=check[i][j+1] then
put verticalK+1 into verticalK
if verticalK is 5 then
answer verticalK
pass checkIfwin
end if
end if
else
if verticalK is 5 then
answer verticalK
pass checkIfwin
else
put 1 into verticalK
end if
end if
end repeat
end repeat
end checkIfwin


