我想使用VBScript创建一个关于HTML的游戏。这是代码:
Dim args
args=inputbox("Which is correct... A: You don't need HTML to create a webpage / B: HTML is the basics on creating a website / C: We need JavaScript over HTML / D: HTML is a programming language")
If args = A Then
X=MsgBox("You are wrong! HTML is one of the languages used by web developers",0+16,"Wrong")
ElseIf args = B Then
X=MsgBox("You are correct! HTML is the basics on creating a website. You can't use another language without HTML",0+64,"Correct")
ElseIf args = C Then
X=MsgBox("You are wrong! That answer might quite be true with others but no. You still need to install something to use javascript only codes. And you don't need to download anything for HTML!",0+16,"Wrong")
ElseIf args = D Then
X=MsgBox("You are wrong! Programming languages are languages you can use to create programs. Like javascript.",0+16,"Wrong")
Else
X=MsgBox("Answer not valid! Only A or B or C or D",0+16,"Invalid")
End If
即使我放置了A,B,C或D,它总是说“答案无效!只有A或B或C或D”。
为什么?
答案 0 :(得分:0)
要将变量与文本进行比较,您需要引用文本,如下所示:
If args = "A" Then