【发布时间】:2013-04-02 20:24:06
【问题描述】:
我正在尝试弄清楚如何使用 .vbs 在一个条件下使多个事件发生。 (这里我尝试使用 case 语句。)是否有这样的命令,或者我必须为每一行重写命令? (这要在之前的代码行中激活,然后在记事本上输入。)
msgbox("I was woundering how old you are.")
age=inputbox("Type age here.",,"")
Select Case age
Case age>24
x=age-24
WshShell.SendKeys "I see you are "&x&" years older than me."
WshShell.SendKeys "{ENTER}"
Case age<24
x=24-age
WshShell.SendKeys "I see you are "&x&" years younger than me."
WshShell.SendKeys "{ENTER}"
Case age=24
WshShell.SendKeys "Wow were the same age!"
WshShell.SendKeys "{ENTER} "
End Select
【问题讨论】:
标签: events vbscript conditional-statements