请VB高手来帮助找错
private sab command1_click() n=va(text1.text) dim s as interger dim r as long for s= n to 10 step -1 if n <10 then text1.text= "error" exit for end if r=r+s next s labl1.caption=r end sub 这断程序哪里出错了..我看不出来啊 for s= n to 10 step -1 if n <10 then text1.text= "error" exit for end if 这断请高手给解释一下,先谢谢了
开头就错,没有sab是sub private sub command1_click() n=Int(text1.text)'这里应该用int dim s as interger dim r as long r=0 'r要赋初值 for s= n to 10 step -1 if n <10 then text1.text= "error" end if r=r+s next s label1.caption=r end sub for s= n to 10 step -1 if n <10 then text1.text= "error" exit for end if next s '从n到10,以每次减1递减,如果n小于10就text1显示出错,并且退出循环
答:VB其实很简单的,我大学的时候学过 忘了,考的还不错的详情>>