B
This commit is contained in:
parent
e5e8880e41
commit
518da4a923
1019 changed files with 15877 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
PROCdivide(-44, 0)
|
||||
PROCdivide(-44, 5)
|
||||
PROCdivide(0, 5)
|
||||
PROCdivide(5, 0)
|
||||
END
|
||||
|
||||
DEF PROCdivide(numerator, denominator)
|
||||
ON ERROR LOCAL IF FALSE THEN
|
||||
REM 'Try' clause:
|
||||
PRINT numerator / denominator
|
||||
ELSE
|
||||
REM 'Catch' clause:
|
||||
CASE ERR OF
|
||||
WHEN 18: PRINT "Division by zero"
|
||||
WHEN 20: PRINT "Number too big"
|
||||
OTHERWISE RESTORE LOCAL : ERROR ERR, REPORT$
|
||||
ENDCASE
|
||||
ENDIF
|
||||
ENDPROC
|
||||
Loading…
Add table
Add a link
Reference in a new issue