During program execution, the code may detect an error condition. It then has 3 possible responses:-
If at all possible, it is better to avoid the last option, especially during program development. Even if the error has to be fixed it is normally better to see what other problems turn up!
All 3 responses can be handled using the ZEBRA routine ZTELL:-
CALL ZTELL(ID,IFLAG)
where:-
ID is a unique error ID - see section below
IFLAG = 0 Continue processing
= 1 Skip to next event
= 2 Abandon execution
The recommended practice is to print out some diagnostic error message on IQLOG and IQPRNT (see zunit.inc) and then call ZTELL.
The only reason to call ZTELL with IFLAG = 0 is to allow control to pass to the user routine ZTELUS where error statistics could be maintained.
IFLAG = 1 is much more powerful; so long as the program is in the execution phase (as opposed to the initialisation or termination phases) ZTELL will not return to the caller; instead processing reverts to the top level and starts the next event.
IFLAG = 2 forces the program into the termination phase so that histograms e.t.c. can be output. Clearly, this is far better than just calling STOP!
For more information on ZTELL see ZEBRA Reference Manual MZ.