vbscript - VBScript 错误 800A0401 - 预期语句
问题描述
为什么 WSH 在我的代码上抛出一个错误,说有一个
第 1 行字符 1 中的“预期语句”。
这是我的代码:
type = inputbox("What would you like to calculate with? (m = muliplication, d = division, a = addition, s = subtraction)")
if type = not "m" or "s" or "a" or "d" or "M" or "S" or "A" or "D" then
a=msgbox("You did not select one of the options.")
elseif type = "m" or "M" then
input1 = inputbox("You chose multiplication. What is the first number of your math sentence?")
input2 = inputbox("What is the other number of your math sentence?")
output = input1 * input2
display = msgbox("The answer to " & input1 & " " & chrw(0215) & " " & input2 & " is " & output & ".")
elseif type = "d" or "D" then
input1 = inputbox("You chose division. What is the dividend of your math sentence?")
input2 = inputbox("What is the divisor of your math sentence?")
output = input1 \ input2
display = msgbox("The answer to " & input1 & " " & chrw(247) & " " & input2 & " is " & output & ".")
elseif type = "a" or "A" then
input1 = inputbox("You chose addition. What is the first number of your math sentence?")
input2 = inputbox("What is the other number of your math sentence?")
output = input1 + input2
display = msgbox("The answer to " & input1 & " + " & input2 & " is " & output & ".")
elseif type = "s" or "S" then
input1 = inputbox("You chose subtraction. What is the first number of your math sentence?")
input2 = inputbox("What is the other number of your math sentence?")
output = input1 - input2
display = msgbox("The answer to " & input1 & " - " & input2 & " is " & output & ".")
end if
我知道这很明显,但我在第 1 行 char 1 上看不到任何错误。
请向我解释如何解决这个问题。
解决方案
推荐阅读
- javascript - 如何编辑 Jstree 输入文本?
- django - django orm 多个过滤器在相同的多对多字段上
- java - 透明模糊 JFRame?
- applescript - Applescript 值增量检测
- firebase - firebase 如何部署?
- android-sqlite - 如何使用带有两个参数的android SQLITE SELECT?
- java - 使用 Jolt 转换复杂的 Json 数组
- c# - 在 Blazor Server 应用程序中,是否可以将 GraphServiceClient 注入到作用域服务中?
- sql - SQL 中是否有返回 1 行的函数,其中每个活动的 datediff = min?
- python - 使用 xml.etree.ElementTree 捕获所有 XML 元素路径