Do Loop Issue. Please help

Posted on 2013-09-19
Medium Priority
Last Modified: 2013-09-19

I am not sure what to do. I am trying to put in a loop if there is no value entered but I am not getting anywhere. Please advice. I am not sure how to use the loop method.

    strAnswer = InputBox _
                ("Please Enter Test Number:", "Enter Test Number")
    If strAnswer = "" Then
      Wscript.Echo "You Must Enter A Test Number."
Loop while strAnswer = ""

Thanks in advance,
Question by:Vicki05
  • 2
LVL 52

Accepted Solution

Martin Liss earned 1200 total points
ID: 39507099
    strAnswer = InputBox _
                ("Please Enter Test Number:", "Enter Test Number")
    If strAnswer = "" Then
      Wscript.Echo "You Must Enter A Test Number."
   ' Else
    End If
Loop while strAnswer = ""
'Else ' Not sure why this is here

Open in new window

LVL 27

Expert Comment

by:Fred Marshall
ID: 39507393
I don't know VB that well but I'd have to wonder why you need both the test and the loop?

Aren't the DO and the LOOP part of the same structure?
If so, why have the Else?

I guess that amounts to the same thing....

Author Closing Comment

ID: 39507837
Thanks for the solution
LVL 52

Expert Comment

by:Martin Liss
ID: 39507839
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Let us take a look at the scenario, you have a database that is corrupt and you run the ESEUTIL command only to find you are unable to repair it. How do you now get the data back?
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question