Wrox Programmer Forums
|
BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions
This is the forum to discuss the Wrox book VBScript Programmer's Reference, 3rd Edition by Adrian Kingsley-Hughes, Kathie Kingsley-Hughes, Daniel Read; ISBN: 9780470168080
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2006, 01:07 PM
Registered User
 
Join Date: Sep 2006
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

 
Old February 4th, 2008, 03:51 PM
Registered User
 
Join Date: Feb 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to zimi0 Send a message via MSN to zimi0 Send a message via Yahoo to zimi0
Default

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






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with for-each loop athanatos XSLT 0 April 10th, 2006 07:20 PM
Do Until loop with IF crmpicco Classic ASP Databases 2 June 15th, 2005 05:35 PM
For....Loop kliu9 Excel VBA 5 February 10th, 2005 06:43 AM
Do Loop junemo Beginning PHP 8 July 28th, 2004 02:58 AM
nested while loop doesn't loop hosefo81 PHP Databases 5 November 12th, 2003 08:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.