首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VBScript问答误差

VBScript问答误差
EN

Stack Overflow用户
提问于 2017-08-20 17:31:37
回答 1查看 30关注 0票数 0

我想用VBScript创建一个关于HTML的游戏。以下是代码:

代码语言:javascript
复制
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。

为什么会这样呢?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-08-20 17:34:50

要将变量与文本进行比较,需要引用文本,如下所示:

代码语言:javascript
复制
If args = "A" Then
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45784980

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档