标题: [问题求助] VBS怎样将用户4次输入改成1次输入? [打印本页]
作者: zengfuyang 时间: 2012-8-23 18:03 标题: VBS怎样将用户4次输入改成1次输入?
本帖最后由 zengfuyang 于 2013-3-24 16:27 编辑
现在我有4条让用户输入的语句,因为4次输入太麻烦,想一次性输入,可以吗?代码如下:
strOne = InputBox("Please type one string","Input")
strTwo= InputBox("Please type two string","Input")
strThree = InputBox("Please type three string","Input")
strFour = InputBox("Please type you four string","Input")
求大神帮忙啊!
作者: broly 时间: 2012-8-29 22:59
- Dim arr
-
- arr = Array("One","Two","Three","Four")
-
- For var = 0 To UBound(arr)
- Execute("str"&arr(var)&" = InputBox(""Please type " & _
- LCase(arr(var))&" string"",""Input"")")
- Next
复制代码
作者: broly 时间: 2012-8-29 23:09
理解错误。- Dim str,arr
-
- str = InputBox("多次输入,用'#'字符隔开","Input")
- arr = Split(str,"#")
-
- For Each var In arr
- MsgBox var
- Next
复制代码
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |