#老是报错
if gs_qq="vip" then
cb_yes.text="√"
cb_no.text="×"
if ls_right ="√" THEN shl_13.text="恭喜您,答对!"
if ls_right ="×" THEN shl_13.text="您答错了,加油"
if ls_right ="√" THEN question_id="57199"
end if
你这是sql?怎么看着像VB呢,你贴出错误信息看下。
从代码看,有几个可能的错误:
1. 缺少end if语句,if语句需要配对出现
2. gs_qq 和 ls_right 变量未定义,应该先定义然后使用
3. question_id 变量定义后没有使用,应该在需要使用的地方定义
4. cb_yes,cb_no,shl_13 等控件未定义,使用前需要定义
所以,修改后的代码可以是:
vb
Dim gs_qq As String
Dim ls_right As String
If gs_qq="vip" Then
Dim cb_yes As Object
Dim cb_no As Object
cb_yes.text="√"
cb_no.text="×"
If ls_right ="√" Then
Dim shl_13 As Object
shl_13.text="恭喜您,答对!"
End If
If ls_right ="×" Then
shl_13.text="您答错了,加油"
End If
End If
Dim question_id As String
If ls_right ="√" Then
question_id="57199"
End If
需要注意:
1. 加入所有需要的End If语句
2. 先定义后使用变量
3. 定义但不使用的变量最好注释或者删除
4. 使用控件前定义
5. 语句要对齐,便于阅读