RosettaCodeData/Task/Detect-division-by-zero/BASIC/detect-division-by-zero-4.basic
2019-09-12 10:33:56 -07:00

12 lines
322 B
Text

result = DetectDividebyZero(1, 0)
Function DetectDividebyZero(a, b)
On Error GoTo [Error]
DetectDividebyZero= (a/ b)
Exit Function
[Error]
If Err = 11 Then '11 is the error number raised when divide by zero occurs
Notice "Divide by Zero Detected!"
End If
End Function