RosettaCodeData/Task/Detect-division-by-zero/BASIC/detect-division-by-zero-4.b...

13 lines
322 B
Plaintext

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