RosettaCodeData/Task/Detect-division-by-zero/XPL0/detect-division-by-zero.xpl0
2023-07-01 13:44:08 -04:00

6 lines
188 B
Text

include c:\cxpl\codes;
int A, B;
[Trap(false); \turn off error trapping
B:= 1234/(A-A); \(error not detected at compile time)
if GetErr then Text(0, "Divide by zero");
]