	SUBROUTINE ERRMSG (MSG)
C COPYRIGHT (C) 1983 GLENN EVERHART
C PERMISSION IS GIVEN TO ANYONE TO USE, DISTRIBUTE, OR COPY THIS
C PROGRAM FREELY BUT NOT TO SELL IT COMMERICALLY.
	INCLUDE 'VKLUGPRM.FTN'
	PARAMETER CUP=1
C	PARAMETER RRW = 32
C	PARAMETER RCL = 32
C RRW=MAX REAL ROWS
C RCL=MAX REAL COLS
C RRW MUST BE 1 LARGER TO HANDLE 1ST 27 VARIABLES IN AVBLS
C VBLS AND TYPE DIMENSIONED RRW,RCL
C **************************************************
C *                                                *
C *       SUBROUTINE  ERRMSG(MSG)                  *
C *                                                *
C **************************************************
C
C
C PRINTS OUT ERROR MESSAGES AS REQUESTED BY CODE IN MSG.
C
C
C
C
C
C ERRMSG IS CALLED BY THE FOLLOWING ROUTINES:
C
C AT
C BASCNG
C CALBIN
C CALC
C CALUN
C CMND
C CONTYP
C DECLR
C ERRCX
C INPOST
C MULADD
C MULDIV
C MULMUL
C NEXTEL
C POSTVL
C VAROUT
C ZNEG
C
C
C
C
C
C
C MODIFICATION CLASSES: M1
C
C
C
C    VARIABLE    USE
C
C   I         TEMPORARY VARIABLE TO AVOID SIDE-EFFECT WITH CALLS
C             THAT USE A CONSTANT FOR THE ARGUMENT.
C   MSG       ERROR MESSAGE CODE.
C
C
C
C  NOTE: USE CODE 25 FOR UNKNOWN CAUSES.
C
C
C
C	SUBROUTINE ERRMSG (MSG)
C
	INTEGER*2 MSG,I
C
	CALL UVT100(CUP,1,10)
	WRITE(1,9999)
9999	FORMAT(' *** ERROR *** ',$)
	GOTO (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21),MSG
	I=MSG-21
	GOTO (22,23,24,25,26,27), I
	GO TO 25
C
C
C
C
C
C
1	WRITE (1,100)
	GO TO 99
2	WRITE (1,200)
	GO TO 99
3	WRITE (1,300)
	GO TO 99
4	WRITE (1,400)
	GO TO 99
5	WRITE (1,500)
	GO TO 99
6	WRITE (1,600)
	GO TO 99
7	WRITE (1,700)
	GO TO 99
8	WRITE (1,800)
	GO TO 99
9	WRITE (1,900)
	GO TO 99
10	WRITE(1,1000)
	GO TO 99
11	WRITE(1,1100)
	GO TO 99
12	WRITE(1,1200)
	GO TO 99
13	WRITE(1,1300)
	GO TO 99
14	WRITE(1,1400)
	GO TO 99
15	WRITE (1,1500)
	GO TO 99
16	WRITE (1,1600)
	GO TO 99
17	WRITE (1,1700)
	GO TO 99
18	WRITE (1,1800)
	GO TO 99
19	WRITE (1,1900)
	GO TO 99
20	WRITE (1,2000)
	GO TO 99
21	WRITE (1,2100)
	GO TO 99
22	WRITE (1,2200)
	GO TO 99
23	WRITE (1,2300)
	GO TO 99
24	WRITE (1,2400)
	GO TO 99
25	WRITE (1,2500)
	GO TO 99
26	WRITE(1,2600)
	GOTO 99
27	WRITE(1,2700)
C
C
99	RETURN
C
C
100	FORMAT ('+FIRST CHARACTER IS ILLEGAL')
200	FORMAT ('+TOO MANY INDIRECT FILE LEVELS')
300	FORMAT ('+UNIDENTIFIED COMMAND')
400	FORMAT ('+ILLEGAL CHARACTER IN DECLARATION VARIABLES LIST')
500	FORMAT ('+VARIABLES IN DECLARATION NOT SEPARATED BY COMMAS')
600	FORMAT ('+UNBALANCED PARENTHESIS')
700	FORMAT ('+STACK 1 OVERFLOW')
800	FORMAT ('+ILLEGAL EXPRESSION')
900	FORMAT ('+STACK 2 OVERFLOW')
1000	FORMAT ('+FUNCTION IS ILLEGAL FOR INTEGRAL (BASE 10,',
     ;  ' 8, AND 16) ARGUMENTS')
1100	FORMAT ('+ILLEGAL FUNCTION FOR MULTIPLE PRECISION NUMBERS')
1200	FORMAT ('+FUNCTION IS ILLEGAL WITH ASCII ARGUMENT')
1300	FORMAT ('+FUNCTION IS ILLEGAL WITH REAL (DECIMAL) ARGUMENT')
1400	FORMAT ('+SQUARE ROOT HAS NEGATIVE ARGUMENT')
1500	FORMAT ('+MULTIPLE PRECISION EXPONENTIATION, NEGATIVE POWER')
1600	FORMAT ('+VARIABLE UNDEFINED')
1700	FORMAT ('+ILLEGAL USE OF = SIGN')
1800	FORMAT ('+UNIDENTIFIED FUNTION')
1900	FORMAT ('+ILLEGAL BASE SPECIFICATION')
2000	FORMAT ('+ILLEGAL CHARACTER')
2100	FORMAT ('+. MAY ONLY BE USED WITH BASE 10')
2200	FORMAT ('+MULTIPLE PRECISION LIMIT OF 99 DIGITS EXCEEDED')
2300	FORMAT ('+ATTEMPT TO DIVIDE BY ZERO')
2400	FORMAT ('+ILLEGAL REAL EXPONENT FIELD SPECIFIED')
2500	FORMAT('+NOTIFY PETER BAUM X7751')
2600	FORMAT('+ILLEGAL CONVERSION ATTEMPTED')
2700	FORMAT('+READ ERROR')
C
C	
	END
