C---------------------------------------------------------------
C  GSCRSC - RESCUSCITATE PREVIOUSLY USED PLOT SCALE
C
C  ALLOW USER TO SELECT SCALE FROM A PREVIOUSLY DRAWN GRAPH
C
      SUBROUTINE GSCRSC(ISET)
C
C  OUTPUT ISET=0 IF SCALE IS *NOT* SELECTED
C
      INCLUDE 'GSCALE_BLK'
C
      INCLUDE 'PLOT1MMX'
C
C
C *LISMAK* 12-APR-88  GENERATED LOGICAL DECLARATIONS
      LOGICAL LCHAR
      LOGICAL LXOUT
C *LISMAK* END OF GENERATED LOGICAL DECLARATIONS
C
      ISET=0
      IF(NSCPRV.EQ.0) THEN
        CALL UERMSG(
     >' ? GSCRSC - NO PRIOR PLOTS; CANNOT RESET SCALE',' ',1)
        RETURN
      ENDIF
C
 10   CONTINUE
C
      IF(LXOUT(0)) THEN
        CALL NEUPAG
        WRITE(LNOUT(0),1001)
 1001 FORMAT(' *SCALES OF RECENTLY DRAWN GRAPHS (1 = MOST RECENT)'/
     >'   N   XMIN        XMAX        YMIN        YMAX'/
     >'  --  ----------- ----------- ----------- -----------')
        DO 20 ISC=1,NSCPRV
          IN0=NCURSC+MXSPRV-ISC
          IND=MOD(IN0,MXSPRV)+1
          WRITE(LNOUT(0),1002) ISC,XMINP(IND),XMAXP(IND),
     >             YMINP(IND),YMAXP(IND)
 1002 FORMAT(2X,I2,1X,4(1X,1PE11.4))
 20     CONTINUE
      ENDIF
C
      CALL UREAD(
     >'GSCRSC:  ENTER NUMBER N TO SELECT SCALE OR "Q" TO QUIT:$$')
      IF(LCHAR('Q')) RETURN
C
      ID=IDCOD(IERT)
      IF(IERT.NE.0) GO TO 10
      IF((ID.LE.0).OR.(ID.GT.NSCPRV)) THEN
        CALL UERMSI('?GSCRSC - INPUT OUT OF RANGE',ID,1)
        GO TO 10
      ENDIF
C
      IN0=NCURSC+MXSPRV-ID
      ISET=MOD(IN0,MXSPRV)+1
C
      XMIN=XMINP(ISET)
      XMAX=XMAXP(ISET)
C
      YMIN=YMINP(ISET)
      YMAX=YMAXP(ISET)
C
      RETURN
      END
