G
Giuseppe Chielli
Hi to everyone. I am studying VB.net and I am wondering why this trivial
code doesn't raise any exception:
Option Strict On
Imports System
Imports Microsoft.VisualBasic
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim num1, num2 As Short
Dim num3 As Double
num1 = 5
num2 = 0
Try
num3 = num1 / num2
Catch ex As DivideByZeroException
MsgBox("Divisione per 0!")
End Try
End Sub
End Class
No msgbox is executed!!!
I'm using VB 2005 Express Edition.
Should I set anything in the framework or project properties?
Thanks in advance to everyone.
Giuseppe from Italy.
code doesn't raise any exception:
Option Strict On
Imports System
Imports Microsoft.VisualBasic
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim num1, num2 As Short
Dim num3 As Double
num1 = 5
num2 = 0
Try
num3 = num1 / num2
Catch ex As DivideByZeroException
MsgBox("Divisione per 0!")
End Try
End Sub
End Class
No msgbox is executed!!!
I'm using VB 2005 Express Edition.
Should I set anything in the framework or project properties?
Thanks in advance to everyone.
Giuseppe from Italy.