

(On Error Resume Next) was converted to a complex pattern which UPGRADE_TODO: (1069) Error handling statement The VBUC would then leave it as follows in C#: private void bttnOK_Click( Object eventSender, EventArgs eventArgs) MsgBox ( "Assume this line throws an error") Now let's look at a code example in VB6.0: Private Sub bttnOK_Click()

NET, or may leave the application in an inconsistent state. These same errors, however, can cause an exception in.

VB6.0 can recover from some errors, so an application can continue without being affected. This statement tells VB6.0 to basically ignore errors and continue execution no matter what. On Error Resume Nextįirst of, let's cover one of the most frustrating statements to migrate from VB6.0: the dreaded On Error Resume Next. In order to enable it, in the Profile, make sure the "On Error To Try Catch" feature is enabled. In this post I will cover a couple of examples on how this transformation is performed.įirst of, this is something that you may not need/want in your application, so this is a features managed through the Migration Profile of the application. The latest release of the Visual Basic Upgrade Companion improves the support for moving from VB6.0's On Error Statements to C# structured error handling, using try/catch blocks.
