473,406 Members | 2,954 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,406 software developers and data experts.

VB6 Equivalent

Is there a .NET #C equivalent of VB6 "On Error Resume Next".
Jun 27 '08 #1
7 975
On 2008-05-22, Phil Hunt <aa*@aaa.comwrote:
Is there a .NET #C equivalent of VB6 "On Error Resume Next".

Not really, the closest would be that you would have to enclose every
line in a try catch statement...

try
{
// one line of code
}
catch {}

try
{
// next line of code
}
catch {}

....
--
Tom Shelton
Jun 27 '08 #2

The #1 thing you can do with a VB6 mentality of exception handling in DotNet
is

1. Put it in a brown paper bag.
2. Take it to someone's house you don't like.
3. Set it on fire.
4. Run away from it as fast as you can.
...

I'm not trying to be mean, but rather FIRM about it.

Check here:
http://blogs.msdn.com/kcwalina/archi...16/396787.aspx
If you're using "resume next" in your VB.NET code, then stop doing it. Just
because you ~can~ doesn't mean you ~should~.

...

Good luck.



"Phil Hunt" <aa*@aaa.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Is there a .NET #C equivalent of VB6 "On Error Resume Next".

Jun 27 '08 #3
On 2008-05-22, sloan <sl***@ipass.netwrote:
>
The #1 thing you can do with a VB6 mentality of exception handling in DotNet
is

1. Put it in a brown paper bag.
2. Take it to someone's house you don't like.
3. Set it on fire.
4. Run away from it as fast as you can.
..
LOL... So true.

--
Tom Shelton
Jun 27 '08 #4
Well, there should be a way available to disable it no matter how good it
is.
"Tom Shelton" <to*********@YOUKNOWTHEDRILLcomcast.netwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
On 2008-05-22, sloan <sl***@ipass.netwrote:
>>
The #1 thing you can do with a VB6 mentality of exception handling in
DotNet
is

1. Put it in a brown paper bag.
2. Take it to someone's house you don't like.
3. Set it on fire.
4. Run away from it as fast as you can.
..

LOL... So true.

--
Tom Shelton

Jun 27 '08 #5
//quote
Well, there should be a way available to disable it no matter how good it
is.
//end quote
Huh?

"Phil Hunt" <aa*@aaa.comwrote in message
news:u1**************@TK2MSFTNGP03.phx.gbl...
Well, there should be a way available to disable it no matter how good it
is.
"Tom Shelton" <to*********@YOUKNOWTHEDRILLcomcast.netwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>On 2008-05-22, sloan <sl***@ipass.netwrote:
>>>
The #1 thing you can do with a VB6 mentality of exception handling in
DotNet
is

1. Put it in a brown paper bag.
2. Take it to someone's house you don't like.
3. Set it on fire.
4. Run away from it as fast as you can.
..

LOL... So true.

--
Tom Shelton


Jun 27 '08 #6
Phil Hunt <aa*@aaa.comwrote:
Well, there should be a way available to disable it no matter how good it
is.
What, exception handling? No, not really. Exceptions are thrown for a
purpose. The closest you can come to ignoring them is to explicitly put
a try/catch block around each statement. This is really painful, for a
very good reason - if something goes wrong, you almost *never* just
want to ignore it and carry on with the very next statement.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 27 '08 #7
Agreed. I always thought of On Error Resume Next as "Close your eyes and
cover your ears and pretend everything is ok, when it isn't".
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
Phil Hunt <aa*@aaa.comwrote:
>Well, there should be a way available to disable it no matter how good it
is.

What, exception handling? No, not really. Exceptions are thrown for a
purpose. The closest you can come to ignoring them is to explicitly put
a try/catch block around each statement. This is really painful, for a
very good reason - if something goes wrong, you almost *never* just
want to ignore it and carry on with the very next statement.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

Jun 27 '08 #8

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

Similar topics

14
by: John | last post by:
Is there an equivalent of COM on Linux that I can get through Python. My need is to have some sort of language independent component framework. I can think of CORBA but I have to have a server...
2
by: Michael Foord | last post by:
Please pardon my ignorance on this one - but I'm not certain how the sign bt is treated in python bitwise operators. I've trying to convert a javascript DES encryption routine into python. ...
3
by: Robert Dodier | last post by:
Hello, Here's a thought that I'm sure has already occurred to someone else, I just can't find any record of it yet. An XML document is just a more verbose and clumsy representation of an...
1
by: Vannela | last post by:
Is there any equivalent control in .NET for the Power builder DataWindow control? I am explaining the Datawindow architecture to some extent. Power Builder DataWindow Control has got different...
6
by: Frank Rachel | last post by:
So I can focus on the correct areas of research, I was wondering if someone could give me the .NET equivelents for this J2EE architecture: JSP's make calls to local JavaBean Controls. The...
3
by: Marty | last post by:
Hi, What is the VB.NET equivalent of the VB6 ADODB.Connector and ADODB.Recordset? Thanks Marty
7
by: Tim Conner | last post by:
Hi, I am an ex-delphi programmer, and I having a real hard time with the following simple code (example ): Which is the equivalent to the following code ? var chars : PChar; sBack, s :...
10
by: karch | last post by:
How would this C# contruct be represented in C++/CLI? Or is it even possible? PolicyLevel level = (enumerator->Current) as PolicyLevel; Thanks, Karch
9
by: Alan Silver | last post by:
Hello, I'm converting some old VB6 code to use with ASP.NET and have come unstuck with the Asc() function. This was used in the old VB6 code to convert a character to its ASCII numeric...
14
by: grid | last post by:
Hi, I have a certain situation where a particular piece of code works on a particular compiler but fails on another proprietary compiler.It seems to have been fixed but I just want to confirm if...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.