C--------------------------------------------------------------
C  URSHOT - CALL UREAD, GET SHOT NUMBER OR OPCODE
C
      SUBROUTINE URSHOT(ZCALLR,ZTRLR,ZOPS,JSHOT,IOP)
C
C  INPUT ARGUMENTS:
C   ZCALLR - CALLER NAME, E.G. "UGRAF2"
C   ZTRLR -- TRAILING STRING IN UREAD PROMPT, ELG. " OR Q TO QUIT:"
C
C   ZOPS --- LIST OF OPCODE CHARACTERS (NON-NUMERIC, PLEASE)
C    WHICH MAY BE SPECIFIED INSTEAD OF SHOT NUMBER
C
C  OUTPUT ARGUMENTS:
C   JSHOT -- SHOT NUMBER READ IN.  VALUE PASSED IN IS *DEFAULT*,
C     RETAINED IF USER TYPES ",".  JSHOT IS CHANGED ONLY IF
C     AN INTEGER DECODE OF USER INPUT IS TRIED
C
C   IOP -- OPCODE.  CLEARED TO ZERO INITIALLY;
C     SET TO CHARACTER LOCATION IN ZOPS MATCHING USER INPUT (IF ANY)
C
      CHARACTER*(*) ZCALLR,ZTRLR
      CHARACTER*(*) ZOPS
C
C
C *LISMAK* 12-APR-88  GENERATED LOGICAL DECLARATIONS
      LOGICAL LCHAR
      LOGICAL LXOUT
C *LISMAK* END OF GENERATED LOGICAL DECLARATIONS
C
      IL=LEN(ZOPS)
C
 10   CONTINUE
C
      if(jshot.le.999999) then
         IF(LXOUT(0)) WRITE(LNOUT(0),1001) JSHOT
 1001    FORMAT(' [OLD SHOT NO.:  ',I6,'; ENTER "," TO RETAIN]')
      else
         IF(LXOUT(0)) WRITE(LNOUT(0),1002) JSHOT
 1002    FORMAT(' [OLD SHOT NO.:  ',I9,'; ENTER "," TO RETAIN]')
      endif
C
      IOP=0
C
      CALL UREAD(ZCALLR//':  ENTER 5 DIGIT SHOT #'//ZTRLR//'$')
C
      IF(LCHAR(' ').OR.LCHAR(',')) GO TO 100
C
      DO 20 I=1,IL
        IF(ZOPS(I:I).EQ.' ') GO TO 20
        IF(LCHAR(ZOPS(I:I))) THEN
          IOP=I
          GO TO 100
        ENDIF
 20   CONTINUE
C
      ISHOT=IDCOD(IERT)
      IF(IERT.NE.0) GO TO 10
C
C  GOT NEW SHOT NUMBER
C
      JSHOT=ISHOT
C
 100  CONTINUE
C
      RETURN
      END
