
GeoBASIC Reference Manual
2.GeoBasic Constructs
TPS1100-Version 1.30
2-39
In the first two cases, error handling takes place (if
Err
<>
0
) according to the
choice then in effect, see below. In the third case, error handling
does not
take
place; execution continues normally, regardless of the error handling choice.
Run-time errors can be handled by the GeoB
ASIC
module in one of the following
three ways.
a) Control is passed to an error handler label. This method is chosen by
executing
ON ERROR GOTO LAB
, where
LAB
is the label of the
statement to which control is to be passed. Leaving the active routine will
reset the value of
Err
to Zero.
b) Execution of a GeoB
ASIC
program is terminated immediately after an error
occurs. This method is chosen by executing
ON ERROR GOTO 0
. This is
also the default choice, active at the start of the GeoB
ASIC
module.
c) Execution continues with the statement after the call, i.e. the error condition
is ignored. This method is chosen by executing
ON ERROR RESUME
NEXT
. The value of
Err
will be kept if the routine returns to the caller.
In methods a) and c) the variable
Err
is set to the return code and can be
inspected by the program. In method b)
Err
is set as well, but the program
terminates execution. Control and the error code will be passed to the point of the
TPS-1100 system where the interpreter has been called.
The activation of an error handler takes place when the execution of an
ON
ERROR
- condition has been passed.
ON ERROR
- conditions may be defined
anywhere in a statement sequence. Passing such a statement resets the value of
Err
to Zero. In this way, the GeoB
ASIC
programmer has the possibility to control
the behaviour of execution depending on the point of execution.
For more information, see the examples below.
CAUTION
It is entirely the application programmer's responsibility to make
sure that no nonsense results from the use of error handler labels.
Particular attention should be paid to the following points.
•
If a label is reached in the normal course of code execution, the statements
following it will be executed as if the label were not present.
•
If "
GOTO
label" (method a) has been chosen and an error occurs, control
will be transferred to that label even when the label is inside a structured
statement or in a different routine.
Содержание tps1100
Страница 1: ...GeoBASIC FOR TPS1100 User Manual Version 2 10 1997 2001 Leica Geosystems AG Heerbrugg Switzerland ...
Страница 150: ...GeoBASIC FOR TPS1100 Reference Manual Version 2 10 1997 2001 Leica Geosystems AG Heerbrugg Switzerland ...
Страница 411: ...GeoBASIC Reference Manual 6 System Functions TPS1100 Version 1 30 6 7 6 5 35 CSV_LibCallAvailable 6 213 ...
Страница 620: ...TPS1100 Version 2 10 6 1 ...
Страница 621: ......
Страница 623: ...TPS1100 Version 2 10 6 1 ...
Страница 624: ......
Страница 1053: ...TPS1100 Version 1 30 E 1 Appendix E GEOFONT ...
Страница 1154: ...GeoBASIC Reference Manual Appendix J List of Predefined Identifiers TPS1100 Version 1 30 J 9 TMC_SetOffsetDist 6 128 ...