Hello everyone,
I am after some help from more experienced programmers. I have used other
scripts as examples from here and ones i have found on google.
The script I have provided below is quite basic, but at this stage I am having
some issues with my looping code.
When I ask the user for a Blue or Red team name with an Input box they are
presented with an OK and a cancel box. A cancel exits the script, however
how do I loop a cancel to then loop all the way to the top of the script
so they now seeing the Msgbox asking again if they are part of blue or red
team with a Yes or No response ? I have looked at loops but if there is something
else I can use please let me know.
I hope someone can provide me some assistance.
Thanking you in advance.
***************************************************************************
Dim team, BTeam, RTeam, pick, choice
pick = Msgbox("Are you part of Blue Team, Otherwise your on Red Team",vbYesNoCancel)
If pick = vbYes Then
team = "Blue"
ElseIf pick = vbNo Then
team = "Red"
Else pick = vbCancel
Wscript.Quit
End If
select case Team
case "Blue"
Do Until choice = vbYes
BTeam = InputBox ("What is your Blue Team name ?")
msgbox "Blue Team Name is " & BTeam
Wscript.Quit
Loop
case "Red"
Do Until choice = vbYes
RTeam = InputBox ("What is your Red Team name ?")
msgbox "Red Team Name is " & RTeam
Wscript.Quit
Loop
end select