• Saves Valuable Time
  • Trusted Accuracy since 2004
  • 15-Day Money-Back Guarantee

Java Equivalent to VB6 Error Handling

VB allows VB6-style error handling for compatibility purposes.  Some elements of VB6 error handling can be converted to try/catch blocks.  Items that cannot be converted and must be addressed via refactoring are: On Error Resume Next, Resume, Resume Next, On Error GoTo -1, and references to the Err object.

For the simplest case, the conversion is trivial:

VB Java
Public Sub LegacyErrorHandling()

    On Error GoTo ErrorHandler
    '... main logic

    '... error handling code
End Sub
public void LegacyErrorHandling()
        //... main logic
        //... error handling code

Use VB to Java Converter to convert from VB to Java.     

Additional resource: VB.NET and Java Equivalents

Copyright © 2004 – 2021 Tangible Software Solutions, Inc.