Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/09/2003, 08:55
zmarquez
 
Fecha de Ingreso: enero-2002
Mensajes: 153
Antigüedad: 23 años, 2 meses
Puntos: 0
Tratamiento de exception VB.NET

Hola,
tengo el siguiente código:


Código:
Try
         iNumPW = CInt(Math.Floor(CDbl((Ancho -(SepLateral * 2)) / pAncho)))
Catch ex As DivideByZeroException
        MsgBox(MsgDivZero, MsgBoxStyle.OKOnly, MsgAtencion)
Catch ex As OverflowException
        MsgBox(MsgDesborda, MsgBoxStyle.OKOnly, MsgAtencion)
End Try
donde Ancho, SepLateral y pAncho son integer.
Supongamos el siguiente caso:
- Ancho=10
- SepLateral=1
- pAncho=0

Por tanto hay una división por cero.

Mi duda es:
¿Porque salta OverFlowException, en lugar de DivideByZeroException?