初学VBS,编写了一段,内容如下,有什么毛病,为什么运行不了?

来源:百度知道 编辑:UC知道 时间:2024/06/20 21:30:50
Dim answer
answer=Inputbox("请输入xxx是不是大坏蛋,请输入yes或no","好人评定系统",answer())
If answer=yes then
Msgbox"恭喜你,答错了",vbinformation,"错误"
If answer=no then
Msgbox"很遗憾,答对了",vbinformation,"正确"
Else
Msgbox"请输入yes或no",vbexclamation,"程序错误"
End If

Dim answer
answer = InputBox("请输入xxx是不是大坏蛋,请输入yes或no", "好人评定系统")
If answer = "yes" Then
MsgBox "恭喜你,答错了", vbInformation, "错误"
ElseIf answer = "no" Then
MsgBox "很遗憾,答对了", vbInformation, "正确"
Else
MsgBox "请输入yes或no", vbExclamation, "程序错误"
End If

Dim answer
answer=Inputbox("请输入xxx是不是大坏蛋,请输入yes或no","好人评定系统")
If answer="yes" then
Msgbox"恭喜你,答错了",vbinformation,"错误"
ElseIf answer="no" then
Msgbox"很遗憾,答对了",vbinformation,"正确"
Else
Msgbox"请输入yes或no",vbexclamation,"程序错误"
End If

这样写就行了,你看看哪里不一样。。。
不明白你为什么要在inputbox的第三个参数写上answer()。。。

不明白你为什么要在inputbox的第三个参数写上answer()。。。