473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Resuming from an error

In VB6 one could use 'Resume Next' to have program execution resume at the
statement following where an error occurred. Is there something comparable
in VB .NET?

Try

i = 0 / 0

DoEvenMore

Catch ex As Exception

End Try

If the eval of i creates an error how do I have the Catch block resume
execution at the procedure DoEvenMore?

JW
Sep 13 '07 #1
4 1080
Jerry West wrote:
In VB6 one could use 'Resume Next' to have program execution resume at the
statement following where an error occurred. Is there something comparable
in VB .NET?
Try
i = 0 / 0
DoEvenMore
Catch ex As Exception
End Try
If the eval of i creates an error how do I have the Catch block resume
execution at the procedure DoEvenMore?
JW
How about

Try
i = 0 / 0
Catch ex As DivideByZeroException
' i = 0 ?
Finally
DoEvenMore()
End Try

--
diwen
Sep 13 '07 #2
"Jerry West" <jw@comcast.netschrieb
In VB6 one could use 'Resume Next' to have program execution resume
at the statement following where an error occurred. Is there
something comparable in VB .NET?

Try

i = 0 / 0

DoEvenMore

Catch ex As Exception

End Try

If the eval of i creates an error how do I have the Catch block
resume execution at the procedure DoEvenMore?
Try

i = 0 / 0

Catch
'no code here. ignore exception.
End Try

DoEvenMore
Don't be surprised if you don't get an exception in this case at all...
Armin
Sep 13 '07 #3

"Jerry West" <jw@comcast.netwrote in message
news:13*************@news.supernews.com...
In VB6 one could use 'Resume Next' to have program execution resume at the
statement following where an error occurred. Is there something comparable
in VB .NET?

Try

i = 0 / 0

DoEvenMore

Catch ex As Exception

End Try

If the eval of i creates an error how do I have the Catch block resume
execution at the procedure DoEvenMore?
You know, you can do an On Error GoTo and Resume Next, which you'll have to
get rid if the try/catch.

Sep 13 '07 #4
Jerry West wrote:
In VB6 one could use 'Resume Next' to have program execution resume at the
statement following where an error occurred. Is there something comparable
in VB .NET?
Yes.

"On Error Resume Next"

Yes, it /still/ works; if you really, /really/ want to.

More likely, though, you'll want to use Try .. Catch ... won't you!?

Sub X()
Try
DoSomethingDodgy()
Catch ex As Exception
' Do Nothing
End Try

DoEvenMore()

End Sub

Unless you [re-]throw the Exception out of the Catch, execution
continues with the next statement /after/ the End Try.

HTH,
Phill W.
Sep 17 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: kajol | last post by:
Hi I am creating a setup project in VS.NET, I have "PluginInstaller.msi" installed in my computer, When I am running this setup program in a test machine where no .NET framework and MDAC2.7 is...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
1
by: LP | last post by:
Hi, I developed a console application that is currently in production. It is scheduled to run every morning (very early morning), to move files from one server to another, update SQL db and then...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
0
by: mike | last post by:
Sound problems resuming from Hibernation I have an MP3 player that plays MP3s off DVD. Uses mci sendstring errreturn = mciSendString("play sound", rs, 128, cb) Been working great for...
13
by: Sheldon | last post by:
Hi. Does anyone know if one can resume a python script at the error point after the error is corrected? I have a large program that take forever if I have to restart from scratch everytime. The...
4
by: John | last post by:
Hi I have several statements in my try block. After catching an exception and dealing with it in catch section, is there a way to resume from next statement in try section kinda like resume next...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.