This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Resume <label>. Fixes #7646
- Loading branch information
1 parent
aaa4b87
commit 4af7649
Showing
5 changed files
with
88 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Module Module1 | ||
Function Main() As Integer | ||
On Error GoTo HandleErrors | ||
|
||
Console.WriteLine("Throwing exception") | ||
Throw New Exception() | ||
|
||
ExitHere: | ||
Console.WriteLine("In resume label") | ||
Return 0 | ||
|
||
HandleErrors: | ||
Console.WriteLine("In error handler") | ||
Resume ExitHere | ||
|
||
Return 1 | ||
End Function | ||
End Module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Module Module1 | ||
Sub TestVB6() | ||
On Error GoTo HandleErrors | ||
|
||
|
||
' Do something in here that | ||
' might raise an error. | ||
|
||
ExitHere: | ||
' Perform cleanup code here. | ||
' Disregard errors in this | ||
' cleanup code. | ||
On Error Resume Next | ||
' Perform cleanup code. | ||
Exit Sub | ||
|
||
HandleErrors: | ||
Select Case Err.Number | ||
' Add cases for each | ||
' error number you want to trap. | ||
Case Else | ||
' Add "last-ditch" error handler. | ||
Console.WriteLine("Error: " & Err.Description) | ||
End Select | ||
Resume ExitHere2 | ||
End Sub | ||
End Module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters