# 测验程式的问题

Posted by 志文 on October 13, 1999 at 21:25:41:

小弟因工作需要,自己想写一个可以测验股票代码的程式
就是我建好股票名称以及股票代码,当我开始测验时,pc出现名称,我输入代码,pc判断对错
目前我label4.caption 放入股票名称
text2.text抓的为股票代码
可是底下的判断,却是失败的,请问各位先进能否指导一下,谢谢

Private Sub Command1_Click() '开始测验
Dim i As Variant
Dim ansq As Variant
correct = 0: wrong = 0
For i = 0 To Data1.Recordset.RecordCount - 1
Label4.Caption = Data1.Recordset.Fields(i + 1).Value
Text2.SetFocus
If Text2(ansq).Text = Data1.Recordset(i).Value Then
correct = correct + 1
CurrentX = 2000: CurrentY = 3000
Print "答对了"
Data1.Recordset.MoveNext
Else
wrong = wrong + 1
CurrentX = 2000: CurrentY = 3000
Print "答错了"
End If
Next
End Sub

Follow Ups:

- Re: 测验程式的问题 小v 09:33:02 10/14/99 (0)
- Re: 测验程式的问题 小v 09:17:19 10/14/99 (0)