C******************** START FILE USPCHK.FOR ; GROUP USPARM *************
C----------------------------------------------------------------
C& USPCHK  SCAN UREAD STRING PARAMETER ASSIGN/USE/PASS LINE
C
      SUBROUTINE USPCHK(ZLINE,LLINE,ISTART,IFIN1,INDEQ,IFINA)
C
C  THIS ROUTINE ADDED TO AID TYPEAHEAD - FIND CHARACTER LIMITS OF
C  STRING PARAMETER STUFF
C
C
C  INPUT - UNPACKED LINE ZLINE(LLINE)
C  ISTART- WHERE TO START SCAN
C
C  OUTPUT- IFIN1 END OF FIRST "GRAMMATIC UNIT" (PARAMETER
C          ASSIGNMENT OR USE)
C          INDEQ - LOCN OF = SIGN IF FIRST UNIT IS ASSIGNMENT
C            (0 OTHERWISE)
C          IFINA - LAST CHAR INVOLVING UREAD STRING PARAMETER
C
      CHARACTER*1 ZLINE(LLINE),MBLANK,MSLASH,MEQS,MCOMMA,MSEMI
C
      DATA MCOMMA/','/
      DATA MBLANK/' '/
      DATA MEQS/'='/
      DATA MSLASH/'/'/
      DATA MSEMI/';'/
C
C--------------------------------------------
C
      IST = 0         ! RGA, was undefined
      ISEMI=IST
      CALL UFCHAR(ZLINE,MSEMI,ISEMI,LLINE)
      IF(ISEMI.GT.0) THEN
        ILINE=ISEMI-1
      ELSE
        ILINE=LLINE
      ENDIF
C
      IPASS=0
      INDEQ=0
      IST=ISTART
      IFIN1=IST
C
 10   CONTINUE
      IFINA=IST
      IF(IST.GE.ILINE) RETURN
      ISTP1=IST+1
      IPASS=IPASS+1
C
      IBL=IST
      CALL UFCHAR(ZLINE,MBLANK,IBL,ILINE)
C  IF BLANK FOLLOWS IMMEDIATELY, EXIT
      IF(IBL.EQ.ISTP1) RETURN
C
      ICL=IST
      CALL UFCHAR(ZLINE,MCOMMA,ICL,ILINE)
C  IF COMMA FOLLOWS IMMEDIATELY, EXIT
      IF(ICL.EQ.ISTP1) RETURN
      ISL=ISTP1
      CALL UFCHAR(ZLINE,MSLASH,ISL,ILINE)
C  IF SLASH FOLLOWS IMMEDIATELY, EXIT
      IF(ISL.EQ.ISTP1) RETURN
C
      IEL=IST+2
      IF(IEL.LT.ILINE) THEN
        CALL UFCHAR(ZLINE,MEQS,IEL,ILINE)
C  CHK FOR DBL "=="
        IF((IEL.GT.0).AND.(IEL.LT.ILINE)) THEN
          IF(ZLINE(IEL+1).EQ.MEQS) THEN
            IELP=IEL+1
          ELSE
            IELP=IEL
          ENDIF
C  CHK 1ST NONBLANK AFTER "=" -- IF A SLASH, EXTEND GRAMMATICAL UNIT
C  TO ALLOW "DELAYED" PARAMETER DEFN "/NAME=/NAME2=VALUE"
          DO IC=IELP+1,ILINE
            IF(ZLINE(IC).NE.MBLANK) THEN
      	IF(ZLINE(IC).EQ.MSLASH) THEN
      	  ISL=IC+1
      	  CALL UFCHAR(ZLINE,MSLASH,ISL,ILINE)
      	ENDIF
      	GO TO 15
            ENDIF
          ENDDO
 15       CONTINUE
        ENDIF
      ELSE
        IEL=0
      ENDIF
C
      IF(IBL.EQ.0) IBL=ILINE+1
      IF(ICL.EQ.0) ICL=ILINE+1
      IF(ISL.EQ.0) ISL=ILINE+1
      IF(IEL.EQ.0) IEL=ILINE+1
C
C  END OF NAME FIELD
C
      INLIM=MIN0(IBL,ICL,ISL,IEL)-1
      INLP1=INLIM+1
C
C  CHECK WHAT'S AFTER NAMEFIELD
 20   CONTINUE
      IF(INLP1.GT.ILINE) THEN
        IFINA=ILINE
        IF(IPASS.EQ.1) IFIN1=IFINA
        RETURN
      ELSE IF(INLP1.EQ.ICL) THEN
C  COMMA TERMINATES
        IFINA=INLIM
        IF(IPASS.EQ.1) IFIN1=IFINA
        RETURN
      ELSE IF(INLP1.EQ.ISL) THEN
C  SLASH ENDS "GRAMMATICAL UNIT" AND STARTS NEW ONE
        IF(IPASS.EQ.1) IFIN1=INLIM
        IST=INLP1
        GO TO 10
      ELSE IF(INLP1.EQ.IEL) THEN
C  EQUAL SIGN INDICATES ASSIGNMENT-- TERMINATED ONLY BY ANOTHER SLASH
        IF(IPASS.EQ.1) INDEQ=IEL
        IF(ISL.GT.ILINE) THEN
          INLP1=ISL
          GO TO 20
        ELSE
C  SLASH ALSO STARTS NEW "UNIT"
          IF(IPASS.EQ.1) IFIN1=ISL-1
          IST=ISL
          GO TO 10
        ENDIF
C  ELSE BLANK... INDETERMINATE,
      ELSE IF(INLP1.EQ.IBL) THEN
C  FIND A NONBLANK
        DO 30 IC=INLP1,ILINE
          IF(ZLINE(IC).NE.' ') GO TO 40
 30     CONTINUE
C  NO NONBLANK
        INLP1=ILINE+1
        GO TO 20
C
 40     CONTINUE
        IF((IC.EQ.ISL).OR.(IC.EQ.IEL).OR.(IC.EQ.ICL)) THEN
          INLP1=IC
          GO TO 20
        ENDIF
C BLANK ENDS PARAMETER STRING UNITS
        IFINA=INLP1
        IF(IPASS.EQ.1) IFIN1=IFINA
        RETURN
      ENDIF
C
C  ERROR IF FELL THRU
C
      IARGHH=1/IARGHH
      RETURN
      END
C******************** END FILE USPCHK.FOR ; GROUP USPARM ***************
