	SUBROUTINE GETNUM(A1,M)
	LOGICAL*1 A1,A2
	M=0
	A1=32
	A2=32
15	READ(5,16,END=22) A1,A2
16	FORMAT(2A1)
	IF(A2.EQ.',') A2="0
	IF(A1.EQ.'E'.OR.A1.EQ.'e') GOTO 1
	IF(A1.EQ.'R'.OR.A1.EQ.'r') GOTO 1
	IF(A1.EQ.'S'.OR.A1.EQ.'s') GOTO 1
	IF(A1.EQ.'#') GOTO 1
	IF(A1.LT.'0'.OR.A1.GT.'9') GOTO 20  ! ERROR
C	CONVERT ASCII TO DECIMAL:
	M=A1-48
	IF(A2.GE.'0'.AND.A2.LE.'9') M=M*10+A2-48
1	IF(M.NE.0) A1='*'
2	RETURN
20	WRITE(5,21)
21	FORMAT(' Error; enter again: ',$)
	GOTO 15
22	A1='C'
	CALL CLOSE(5)
	GOTO 2
	END
