View Single Post
  #1 (permalink)  
Old September 24th, 2006, 01:07 PM
junedali10 junedali10 is offline
Registered User
 
Join Date: Sep 2006
Location: LONDON, , United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

Reply With Quote