批处理之家's Archiver

486616290 发表于 2019-11-24 15:50

帮我看看VBS哪里错了,显示第十行第一个

[code]const title="追星测试"
const yourname="蔡徐坤"
const question="你最喜欢的明星是谁,请在下面方框中输入他的名字"
const scend="你说出了你的心扉,那就向他表白吧~"
dimyouranswer
do
youranswer=inputbox(question,title)
if youranswer <> yourname then
msgbox info,vbinformation
+vbokonly,title
loop until youranswer=yourname
msgbox scend,vbinformation
+vbokonly,title[/code]

batyantou 发表于 2020-3-2 19:34

错误共有三处:
1.msgbox 第一个参数,如果为常量要加“”,不知道楼主此处要显示给用户屏幕的信息是什么(假设你要显示空白)?
2.if 结构缺少end if 结束语。
3.第五行变量声明,应在dim后面加空格。[code]option explicit
const title="追星测试"
const yourname="蔡徐坤"
const question="你最喜欢的明星是谁,请在下面方框中输入他的名字"
const scend="你说出了你的心扉,那就向他表白吧~"
dim youranswer
do
   youranswer=inputbox(question,title)
     if youranswer <> yourname then
        msgbox "",vbinformation + vbokonly,title
     end if
loop until youranswer=yourname
msgbox scend,vbinformation+vbokonly,title[/code]

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.