登录界面3次登录失败 自动退出 请大家帮忙一上

登录界面3次登录失败 自动退出 请大家帮忙一下
调试了1天了,还是不行。总是弹出密码错误的对话框,没有起到计数的效果。请大家帮忙一下啊。

string a,b
a=sle_uid.text
b=sle_pwd.text


if len(a)=0 then
 messagebox("Error","请输入用户名!",stopsign!)
 sle_uid.text=""
 sle_pwd.text=""
 sle_uid.setfocus()
 return
else
if len(a)>0 and len(b)=0  then
 messagebox("Error","请输入密码!",stopsign!)
 sle_pwd.text=""
 sle_pwd.setfocus()
 return
else
string pwd
select pw
into :pwd 
from pas 
where pas.pw=:sle_pwd.text;
int c=0
if pwd <>b and c<3 then 
messagebox('提示','口令输入错误,请重新输入')
sle_pwd.setfocus()
   c++
return
if c>=3 then  
MessageBox("警告","你已输入超过三次,强制退出")  
close(parent)
else
  open(w_main)
  close(w_pas)
end if
end if
end if
end if  

------解决方案--------------------
在窗口的 declare instance  variables  中定义 LONG C
------解决方案--------------------
http://zhidao.baidu.com/question/399451669.html