OPTIONS	X,Q
C
C THIS ROUTINE DEMONSTRATES THE	USE OF THE 'TRACE' AND 'ERROR'
C TRAPPING FUNCTIONS
C
	TYPE 'STARTING EXECUTION'
C
C SET ERROR TRAPPING: ON ERROR GO TO STATEMENT 500 WITH	ERROR CODE
C IN VARIABLE I
C
	ERRSET 500,I
10	CONTINUE
C
C TURN TRACING OFF
C
	TRACE OFF
C
C GET AN INPUT # FROM THE USER
C
	ACCEPT '#: ',K
C
C IF <0, TERMINATE
C
	IF (K .LE. 0)GO	TO 99
C
C IF INPUT # > 100, THEN TURN TRACING ON
C
	IF (K .GT. 100)TRACE ON
C
C AND OUTPUT THE NUMBERS, TO SEE EFFECT	OF THE
C ERROR	TRAPPING, HIT CONTROL-C
C
	DO 20 I=1,K
20	TYPE I
	GO TO 10
C
99	TYPE 'DONE'
	STOP
C
C ERROR	TRAPPING HAPPENS HERE
C
500	TYPE 'ERROR TRAPPED, IER= ',I
	END

20	TYPE I
	GO TO 10
C
99	TYPE 'DONE'
	STOP
C
C ERROR	TRAPPING HA