Intrinsic-17 Trap

Intrinsic-17 Trap

Top  Previous  Next

17: Trap(integer); (Changed)


This intrinsic determines which runtime errors stop the program and display error messages. The default is to trap all errors, but they can be individually disabled. The argument is an integer, each bit of which turns on or off a runtime error:



bit 0:

Integer division by 0

bit 7:

Real underflow out of range


Out of memory space


Fix argument out of range


I/O error


Square root error


Invalid opcode


Logarithm error


Invalid intrinsic


Exponential error


Real division by 0.0


Stack/Heap error


Real overflow


ATan2(0.0, 0.0)


For example, sometimes you do not care if you divide by zero and you certainly do not want your program to stop if you do. Trap($FFFE) will disable this error trap, and the divide will give the best answer it can.