A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
|
|
@ -0,0 +1,11 @@
|
|||
DIV(A,B) ;Divide A by B, and watch for division by zero
|
||||
;The ANSI error code for division by zero is "M9".
|
||||
;$ECODE errors are surrounded by commas when set.
|
||||
NEW $ETRAP
|
||||
SET $ETRAP="GOTO DIVFIX^ROSETTA"
|
||||
SET D=(A/B)
|
||||
SET $ETRAP=""
|
||||
QUIT D
|
||||
DIVFIX
|
||||
IF $FIND($ECODE,",M9,")>1 WRITE !,"Error: Division by zero" SET $ECODE="" QUIT ""
|
||||
QUIT "" ; Fall through for other errors
|
||||
Loading…
Add table
Add a link
Reference in a new issue