Solved

VB.Net force Next in a For Loop

Posted on 2004-04-19
2
1,760 Views
Last Modified: 2008-01-09
Hello,

Is there a way to force a the for loop to skip the iteration it is on and go to the next one? I know there is one in Java, but I can't think if what it may be in VB.

ex.

For i = 0 to count

Try
'some code that may cause an error
Catch ex as exception

'the call to jump to the next iteration of the for loop
End Try

Next

Thanks
0
Comment
Question by:Gezna
2 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
ID: 10859055
Your code is ok it will just go to the next iteration
0
 
LVL 5

Expert Comment

by:rajups
ID: 11037571
instead of using try catch try using on error goto XXX

in the XXX do whcih ever stuff u want to do,nd if u r more specific about the exception use err.getException().raise to raise the exception and finally say resume next

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…

821 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