C****************************************************************
C* 								*
C*								*
C*	DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY *
C*	EITHER FOR THE CREATION OR FOR THE CLINICAL EFFICACY	*
C*	OF THIS PROGRAM. USERS MUST ASSUME FULL RESPONSIBILITY	*
C*	FOR ANY RESULTS OR DIAGNOSES OBTAINED FROM THE USE	*
C*	OF THIS PROGRAM. QUESTIONS ON THE EXECUTION OF THIS	*
C*	PROGRAM MUST BE REFERRED BACK TO THE ORIGINAL AUTHOR.	*
C*								*
C* AUTHOR:	SALLY FORSTER					*
C*		C/O DEPARTMENT OF NUCLEAR MEDICINE		*
C*		GUY'S HOSPITAL				*
C*		LONDON, ENGLAND					*
C*								*
C*		TEL: 01-407-7600 EXT 2583/4			*
C*								*
C****************************************************************
	FUNCTION IGTPAR(J)
C*****DECODES PARAMETER STRING
C*****RETURNS PARAMETER J AS THE NUMBER OF PARAMETERS READ
C*****STORES PARAMETERS AS INTEGERS IN ARRAY CPAR(10) COMMON INPARA
C*****STORAGE REGISTER PARAMETERS ARE RETURNED AS THE NEGATIVE INDEX
C*****RETURNS FUNCTION VALUE < 0 FOR FORMAT ERROR
	IMPLICIT LOGICAL*1 (A)
	IMPLICIT INTEGER *2(D-Z)
	COMMON/IN/NA,A(76),LP,ASEMIC,ASPACE
	COMMON/INPARA/CPAR(10)
	DATA AMINUS,ACOMMA,AR,AP/'-',',','R','P'/
	DO 100 J=1,10
1	IF(A(LP).NE.ASPACE)GOTO 5
	LP=LP+1
	GOTO 1
5	IF(A(LP).NE.AR)GOTO 10
	CPAR(J)=-10
	GOTO 15
10	IF(A(LP).NE.AP)GOTO 25
	CPAR(J)=0
15	IA=(A(LP+1)-"60).AND."000377
	IF(IA.LT.0.OR.IA.GT.9)GOTO 600
	CPAR(J)=CPAR(J)-FLOAT(IA+1)
	LP=LP+2
20	IF(A(LP).EQ.ACOMMA)GOTO 100
	IF(A(LP).EQ.ASEMIC)GOTO 200
	IF(LP.GT.NA)GOTO 200
	IF(A(LP).NE.ASPACE)GOTO 600
	LP=LP+1
	GOTO 20
C*****INTEGER CONSTANT
25	DO 26 I=LP,NA
	IF(A(I).EQ.AMINUS)GOTO 500
	IF(A(I).EQ.ASPACE)GOTO 27
	IF(A(I).EQ.ACOMMA)GOTO 27
	IF(A(I).EQ.ASEMIC)GOTO 27
26	CONTINUE
	I=NA+1
27	IA=I-LP
	IF(IA.LT.1)GOTO 450
	DECODE(IA,1000,A(LP),ERR=600)CPAR(J)
	LP=I
	DO 30 LP=LP,NA
	IF(A(LP).EQ.ACOMMA)GOTO 100
	IF(A(LP).EQ.ASEMIC)GOTO 200
30	CONTINUE
	LP=NA+1
	GOTO 200
100	LP=LP+1
	J=10
200	LP=LP+1
	IGTPAR=0
	RETURN
C*****ZERO PARAMETERS
450	IF(J.NE.1)GOTO 600
	J=0
	GOTO 200
500	WRITE(7,510)
510	FORMAT(1X,'NEATIVE CONSTANTS NOT PERMITTED')
600	IGTPAR=-1
	RETURN
1000	FORMAT(F20.0)
	END
