处理(用户)选择列表时如何返回一步?
How can I go back one step when processing a list of (user) choices?
我有一系列用户选择(作为输入框实现)。简短示例:
Answer = InputBox("Choose: 1 - One 2 - Two", "Choose"))
If Answer = "1" Then
Answer = InputBox("Choose: 1 - Hi 2 - Hello", "Choose"))
If Answer = "1" Then....
我想知道VBScript 是否可以返回到之前的选择。来自
InputBox("Choose: 1 - Hi 2 - Hello 3 - BACK", "Choose"))
如果我输入3我想后退一步。我尝试 history.go(-1)
,但出现错误。他想要对象 "history".
将第一个选择放在 Do 循环中,只有在第二个提示中选择了 3 以外的其他内容时才使用 Exit Do
退出循环。
Do
Answer = InputBox("Choose: 1 - One 2 - Two", "Choose")
If Answer = "1" Then
MyVal = LevelTwoSelect
End If
If MyVal <> 3 Then Exit Do
Loop
Function LevelTwoSelect
Answer = InputBox("Choose: 1 - Hi 2 - Hello 3 - BACK", "Choose")
If Answer = "1" Then LevelTwoSelect = 1
If Answer = "2" Then LevelTwoSelect = 2
If Answer = "3" Then LevelTwoSelect = 3
End Function
我有一系列用户选择(作为输入框实现)。简短示例:
Answer = InputBox("Choose: 1 - One 2 - Two", "Choose"))
If Answer = "1" Then
Answer = InputBox("Choose: 1 - Hi 2 - Hello", "Choose"))
If Answer = "1" Then....
我想知道VBScript 是否可以返回到之前的选择。来自
InputBox("Choose: 1 - Hi 2 - Hello 3 - BACK", "Choose"))
如果我输入3我想后退一步。我尝试 history.go(-1)
,但出现错误。他想要对象 "history".
将第一个选择放在 Do 循环中,只有在第二个提示中选择了 3 以外的其他内容时才使用 Exit Do
退出循环。
Do
Answer = InputBox("Choose: 1 - One 2 - Two", "Choose")
If Answer = "1" Then
MyVal = LevelTwoSelect
End If
If MyVal <> 3 Then Exit Do
Loop
Function LevelTwoSelect
Answer = InputBox("Choose: 1 - Hi 2 - Hello 3 - BACK", "Choose")
If Answer = "1" Then LevelTwoSelect = 1
If Answer = "2" Then LevelTwoSelect = 2
If Answer = "3" Then LevelTwoSelect = 3
End Function