473,394 Members | 1,642 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,394 software developers and data experts.

Try Catch ?

Hi ,

Can some one tell me what is the BIG issue around the try catch mechanism ?

what is the deferent between the try catch in .NET and the on error resume
next in VB6

beside that i can eliminate the errors ?
Best Regards ,

Tiraman :-)
Nov 20 '05 #1
4 1866
Try Catch is more structured and just all around better.
You have blocks of code that can be nested inside eachother, with clear
logic about exactly what will happen in case of an error.
The fact that the "GOTO" statement is associated with the old ON ERROR
technique should be a clue that it tends to result in spaghetti code.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
Hi ,

Can some one tell me what is the BIG issue around the try catch mechanism ?
what is the deferent between the try catch in .NET and the on error resume
next in VB6

beside that i can eliminate the errors ?
Best Regards ,

Tiraman :-)

Nov 20 '05 #2
10x

"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Try Catch is more structured and just all around better.
You have blocks of code that can be nested inside eachother, with clear
logic about exactly what will happen in case of an error.
The fact that the "GOTO" statement is associated with the old ON ERROR
technique should be a clue that it tends to result in spaghetti code.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
Hi ,

Can some one tell me what is the BIG issue around the try catch mechanism
?

what is the deferent between the try catch in .NET and the on error

resume next in VB6

beside that i can eliminate the errors ?
Best Regards ,

Tiraman :-)


Nov 20 '05 #3
Tiraman,
In addition to Steve's comments:

See the "Use Structured Exception Handling Rather Than On Error Statement"
section of:
http://msdn.microsoft.com/vstudio/us...tinternals.asp
Also there were a couple long threads a year or so ago on the matter of Try
Catch verses On Error, however I don't have the links handy, you could try
searching this newsgroup at http://groups.google.com for the threads.

Hope this helps
Jay

"Tiraman" <ti*****@netvision.net.il> wrote in message
news:OQ**************@TK2MSFTNGP09.phx.gbl...
Hi ,

Can some one tell me what is the BIG issue around the try catch mechanism ?
what is the deferent between the try catch in .NET and the on error resume
next in VB6

beside that i can eliminate the errors ?
Best Regards ,

Tiraman :-)

Nov 20 '05 #4
Hi Tiraman,

I thought I shall help Jay a little bit and separatly give my opinion and
than I saw it was direct in this thread.

http://tinyurl.com/3y2wn

Cor
Nov 20 '05 #5

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

Similar topics

10
by: Gary.Hu | last post by:
I was trying to catch the Arithmetic exception, unsuccessfully. try{ int a = 0, b = 9; b = b / a; }catch(...){ cout << "arithmetic exception was catched!" << endl; } After ran the program,...
11
by: kaeli | last post by:
Hey all, I'd like to start using the try/catch construct in some scripts. Older browsers don't support this. What's the best way to test for support for this construct so it doesn't kill...
4
by: Abhishek Srivastava | last post by:
Hello All, I have seen code snippets like try { ..... } catch {
11
by: Pohihihi | last post by:
I was wondering what is the ill effect of using try catch in the code, both nested and simple big one. e.g. try { \\ whole app code goes here } catch (Exception ee) {}
13
by: Benny | last post by:
Hi, I have something like this: try { // some code } catch // note - i am catching everything now {
23
by: VB Programmer | last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally. Example: In order to close/dispose a db connection you have to dim the connection outside of the Try Catch Finally...
32
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I...
23
by: pigeonrandle | last post by:
Hi, Does this bit of code represent complete overkill?! try { //create a treenode TreeNode tn = new TreeNode(); //add it to a treeview tv.Nodes.Add(tn);
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.