Do....Loop While loop
Hi, i am new to vbscript and brought the vbscript book.
I just needed to know why the following code does not work prperly.
It's on page 14.
------------------------------------------------------
Dim Greeting
Dim YourName
Dim TryAgain
Do
TryAgain = "No"
YourName = InputBox("Please enter your name:")
If YourName = "" Then
MsgBox "You must enter your name to continue."
TryAgain = "Yes"
Else
Greeting = "Hello, " & YourName & ", great to meet you."
End If
Loop While TryAgian = "Yes"
MsgBox Greeting
------------------------------------------------------------------
The code does not seem to start again from the begining when i dont enter any input. I get the first MsgBox and then when i click "ok" i get a second MsgBox with no message. When i click "ok" it just closes and nothing else seems to happen.
Can anyone tell me why this is?
When i do
|