Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Condition in a loop

Posted on 1999-06-21
5
Medium Priority
?
164 Views
Last Modified: 2010-05-02
I'm reading a file and if a portion of the string I read in is not numeric I do not want to execute the instructions in the loop (see example). I want to go back and read the next record.  Is there a "continue" instruction in VB.  I think I've done this before, but I'm drawing a blank.

Thanks.


Do Until (EOF(1) = True)

read record

if not isnumeric(x) then
  start at the beginning of the loop
end if

  otherwise execute other instructions

loop
 
0
Comment
Question by:m300d
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 200 total points
ID: 1518810
how about this??

Do Until (EOF(1) = True)
continue:

             read record

             if not isnumeric(x) then
                goto continue
             end if

               otherwise execute other instructions

             loop

??

..-=ViKtOr=-..
0
 

Author Comment

by:m300d
ID: 1518811
Is there any other way than using a "goto"?

Thanks
0
 
LVL 12

Expert Comment

by:jgv
ID: 1518812
Process the code only if the value of x is numeric.

Do Until (EOF(1) = True)

read record

if isnumeric(x) then
  execute instructions
end if

loop

0
 

Author Comment

by:m300d
ID: 1518813
Thanks, I figured that out from looking at your first suggestion. I increased the points to 50.
0
 
LVL 12

Expert Comment

by:jgv
ID: 1518814
First suggestion? Two different people m300d :o)
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 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