L
Larry Woods
Look at this code:
Dim i As Integer = 0
Dim j As Integer = 5
If (j / i = 7) Or i = 0 Then
MessageBox.Show("In If")
Else
MessageBox.Show("In Else")
End If
I would have expected to get an error thrown in the execution of the "If"
statement since the division operation will cause a "divide by zero"
exception. But this doesn't happen. The following statement, added before
the "If" WILL cause an exception...natually:
j=j/i
What rule states that an If statement is "exempt" from errors? Or, better
yet, what am I missing?
TIA,
Larry Woods
Dim i As Integer = 0
Dim j As Integer = 5
If (j / i = 7) Or i = 0 Then
MessageBox.Show("In If")
Else
MessageBox.Show("In Else")
End If
I would have expected to get an error thrown in the execution of the "If"
statement since the division operation will cause a "divide by zero"
exception. But this doesn't happen. The following statement, added before
the "If" WILL cause an exception...natually:
j=j/i
What rule states that an If statement is "exempt" from errors? Or, better
yet, what am I missing?
TIA,
Larry Woods