IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Error trapping with VB.NET
The way we used to do it with VB 6.0 and under was like this:

On Error Goto ErrorTrap1:

i = i / 0

Exit Sub

ErrorTrap1:
Msgbox "Got an error! " & Err.Description

Or

On Error Resume Next
Err.Clear

i = i / 0

If err.Number > 0 Then
Msgbox "Got an error! " & Err.Description
End If

In VB.NET error trapping will have to be re-written! Joy!

Try
i = i / 0
Catch e as Exception
Messagebox.Show("Got an error! " & e.Message)
End Try

The "Try" statement, get used to it!

Try
(Try_Statements)
[Catch [(variable) [As (type)]][When (expression)]
(catch_statements>]
[Catch [(variable) [As (type)]][When (expression)]
(catch_statements)]
...
[Finally
(finally_statements)]
End Try

It looks like the "Finally" part is optional, but can be used to close files, close database connections, empty objects, etc. This is the cleanup part.

You can apparently have multiple catch parts, these appear to be the error handling routines or the error message routines.

Learned something new today. :)

"I can see if I want anything done right around here, I'll have to do it myself!"Moe Howard
New Turning into C++
MS is slowly turning VB into C++, all of the VB changes I have seen so far for .NET are C++ stuff adapted to VB because the .NET runtime is really a C++. Rather then build a real language independent runtime or handeling the problem in the VB layer they are just pushing C++ stuff into VB at the language level.

Try/Catch isn't so bad, it's ultimatly cleaner then VB's old system. But I hate the += type syntax, all you gain is saving a few keystrokes, but you also get some nastly ordering problems and have to memorize a whole load of new operators.


Jay
New I think I'm turning into a C++ Developer
Since VB.NET is slowly turning into C++ and taking the way they do things from C++ then. Frelling hot stuff, I might as well use a C++ compiler and do things the right way. I got to dust off my Borland C++ 5.0 CD, and get my hands on a GNU C++ compiler and start coding away. It will just save time that way!
"I can see if I want anything done right around here, I'll have to do it myself!"Moe Howard
New VB.NET is
......taking the world's top-selling language and making it resemble the worlds 2nd-top-selling language (Java).

I guess it is time to change careers.

At least until MS sets its targets on some other popular language that will no doubt grow in popularity due to the gap left by MS's targeting approaches.
________________
oop.ismad.com
     Visual BASIC 6.0 verses Visual BASIC .NET - (orion) - (7)
         Someone give me a *good* link to .net? - (wharris2) - (6)
             .NET links - (orion)
             Things to come with .NET - (orion) - (4)
                 Error trapping with VB.NET - (orion) - (3)
                     Turning into C++ - (JayMehaffey) - (2)
                         I think I'm turning into a C++ Developer - (orion)
                         VB.NET is - (tablizer)

We sell COFFEE-flavored coffee.
49 ms