我想用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。
为什么会这样呢?
发布于 2017-08-20 17:34:50
要将变量与文本进行比较,需要引用文本,如下所示:
If args = "A" Thenhttps://stackoverflow.com/questions/45784980
复制相似问题