Remote-processing BASIC 52 Manual de usuario Pagina 88

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 163
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 87
RPBASIC-52 PROGRAMMING GUIDE
2-69
ONERR
Syntax: ONERR line number
Function: Goes to line number on arithmetic error, b ad argument, and hardw are errors.
Mode: Run
Use: ONERR 1000
Cards: All
DESCRIPTION
The ONER R instruction traps arithmetic errors and hardware problems, transferring control to line number.
ONERR can be used to handle errors generated due to bad user input from and INPUT instruction. ONERR
is a GOTO, not a GOSUB. Consequently, there is no easy way to resume program execution. The control
and argument stacks are cleared so all GOSUB 's, FOR-NEXT loops, etc. are cleared.
Error codes are stored at external memory location 257 (101H) and are accessed using the XBY instruction.
Code Error
0AH (10) DIVIDE BY ZERO
14H (20) ARITH OVERFLOW
1EH (30) ARITH UNDERFLOW
28H (40) BAD ARGUMENT
32H (50) HARDWARE
EXAMPLE
100 ONERR 1000
110 A=1/0
1000 PRINT "Error code:",XBY(257)
>run
Error code: 10
Vista de pagina 87
1 2 ... 83 84 85 86 87 88 89 90 91 92 93 ... 162 163

Comentarios a estos manuales

Sin comentarios