Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module modMain
- Function main(ByVal cmdargs() As String) As Integer
- Dim lbLocal As Boolean = False ' toggle me !
- Try
- If lbLocal Then
- 'Local test: generate error within main()
- Dim liI As Long = CLng(1 / liI)
- Else
- 'Form test: generates error under button's event
- Dim goFrm As frmMain
- goFrm = New frmMain
- goFrm.ShowDialog()
- End If
- Catch ex As Exception
- ' This is not fired when lbLocal=FALSE in RELEASE version, but is fired in DEBUG version
- MsgBox(ex.ToString)
- End Try
- Return 0
- End Function
- end module
- Public Class frmMain
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- ' Generates an error under button click event
- Dim liI As Long = CLng(1 / liI)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement