Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1777
  • Last Modified:

VB.Net force Next in a For Loop

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
Gezna
Asked:
Gezna
1 Solution
 
RonaldBiemansCommented:
Your code is ok it will just go to the next iteration
0
 
rajupsCommented:
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

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now