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

   1:

Out of memory space

  8:

Fix argument out of range

   2:

I/O error

  9:

Square root error

   3:

Invalid opcode

10:

Logarithm error

   4:

Invalid intrinsic

11:

Exponential error

   5:

Real division by 0.0

12:

Stack/Heap error

   6:

Real overflow

13:

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.