Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 24th, 2006, 01:07 PM
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
  #2 (permalink)  
Old February 4th, 2008, 02:51 PM
Registered User
 
Join Date: Feb 2008
Location: New York, NY, USA.
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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05: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 07:46 AM



All times are GMT -4. The time now is 07:10 AM.


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