|
|
||||||
|
#1
|
|
|
|
|
Is there a .NET #C equivalent of VB6 "On Error Resume Next".
|
|
|
|
#2
|
|
|
|
|
On 2008-05-22, Phil Hunt <aaa> wrote:
> 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 {} .... |
|
#3
|
|
|
|
|
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" <aaa> wrote in message news:4772 |
|
#4
|
|
|
|
|
On 2008-05-22, sloan <sloan> wrote:
> > 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. |
|
#5
|
|
|
|
|
Well, there should be a way available to disable it no matter how good it
is. "Tom Shelton" <tom_shelton> wrote in message news:3500 [..] |
|
#6
|
|
|
|
|
//quote
Well, there should be a way available to disable it no matter how good it is. //end quote Huh? "Phil Hunt" <aaa> wrote in message news:3564 [..] |
|
#7
|
|
|
|
|
Phil Hunt <aaa> wrote:
> 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. |
|
#8
|
|
|
|
|
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]" <skeet> wrote in message news:2cd3 [..] |
|
|
| Similar Threads | |
| VBA or VB.net equivalent of Equivalent of WordBasic WordBasic.SelectCurWord I have a old wordbasic code that I am converting to VSTO what is equivalent of Word 97 (WordBasic) code WordBasic.SelectCurWord in VSTO Tried several... |
|
| Equivalent of GetPrivateProfileString equivalent in C#? Does C# has an equivalent of the 'C' GetPrivateProfileString? or is the only way to get similar features to read from an INI file is to do a DllImport on Kernel32.dll? Thanks |
|
| a[i] not equivalent to *(a+i)? Hello, I have a question regarding old good array and pointers. I remember reading a remark by Bjarne Stroustrup that a[i] is not equivalent to *(a+i) when it comes to... |
|
| MRU equivalent in .NET Is there an equivalent implementation of CRecentFileList (MFC) in the .NET framework, or a sample of how to do this efficiently. Right now I am just using an array of... |
|
| Are these equivalent? Are the following two statements equivalent? bitField = (bitField & (--bitField)); bitField = (bitField & (bitField-1)); Yes or no? |
|
|
All times are GMT. The time now is 03:24 PM. | Privacy Policy
|