Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VB -> C#: Conversion for OnErrorGoToLabelStatement not implemented #997

Closed
ctrl-alt-d opened this issue Mar 24, 2023 · 2 comments
Closed
Labels
C# -> VB Specific to C# -> VB conversion

Comments

@ctrl-alt-d
Copy link

Input code

Public Function Save() As Boolean
	On Error GoTo ErrorHandler  ' <----- this line

        Dim zero as Integer = 0
        Dim i as Integer = zero / zero
	
	Exit Function
	
ErrorHandler: 
	err.Raise(Err.Number, "zero / zero", Err.Description)
End Function

Erroneous output

#error Cannot convert OnErrorGoToStatementSyntax - see comment for details
/* Cannot convert OnErrorGoToStatementSyntax, CONVERSION ERROR: Conversion for OnErrorGoToLabelStatement not implemented, please report this issue in 'On Error GoTo ErrorHandler' at character 594

      Input:
                                On Error GoTo ErrorHandler
*/

Expected output

Not sure, maybe a try-catch

Details

  • Product in use: icsharpcode.github.io/CodeConverter command line
  • Version in use: 9.2.0.586
  • Any other relevant information to the issue, or your interest in contributing a fix.
    • Same issue with Conversion for OnErrorResumeNextStatement not implemented
    • On Error Statement documentation
    • Please don't judge me for using this statement. It is automatically ported code from VB6.
@ctrl-alt-d ctrl-alt-d added the C# -> VB Specific to C# -> VB conversion label Mar 24, 2023
@ctrl-alt-d ctrl-alt-d changed the title C# -> VB: Conversion for OnErrorGoToLabelStatement not implemented VB -> C#: Conversion for OnErrorGoToLabelStatement not implemented Mar 24, 2023
@ctrl-alt-d
Copy link
Author

#426 dup

@GrahamTheCoder
Copy link
Member

GrahamTheCoder commented Mar 24, 2023

Thanks, extra real world examples always help. This is on my list to try to cover some simple cases of soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# -> VB Specific to C# -> VB conversion
Projects
None yet
Development

No branches or pull requests

2 participants