p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions (http://p2p.wrox.com/forumdisplay.php?f=51)
-   -   Do....Loop While loop (http://p2p.wrox.com/showthread.php?t=48238)

junedali10 September 24th, 2006 01:07 PM

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


zimi0 February 4th, 2008 03:51 PM

Your loop condition "TryAgian" is spelt incorrectly. should be TryAgain



All times are GMT -4. The time now is 03:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.