C
C   THIS SUBROUTINE PLAYS BACK OR LISTS
C
      SUBROUTINE LISTA(NOP,THM1,MP1)
      LOGICAL B(3),F,LTPEN
      INTEGER THM1(200,3),MP1(75,2)
      CHARACTER ZA*11/'***********'/
      CHARACTER*3 NME(110),NUR(10),TRG(5)
      CHARACTER LIS*4(4)/'(A3,','2X,A','3,1X','A3)'/
      CHARACTER FOR*2(2)/'(A','4)'/,THR*2(2)/'(A','9)'/
      CHARACTER EXIT*4/'EXIT'/,NPG*9/'NEXT PAGE'/,ZZ*12/'************'/
      CHARACTER*3 BAR*6(2)/'(A12,2','X,I4)'/,AA,BB,CC
      COMMON/BBB/NME,NUR,TRG
      COMMON/CCC/ITAG,LTPEN,IX,IY
      F=.FALSE.
      WRITE(7)F,F,F
      IF(NOP.EQ.99)GO TO 4
      NMAX=3
      N=0
      CALL NCRT('CHY',N,NMAX)
      IF(N.EQ.3)RETURN
      IF(N.EQ.1)GO TO 3
    4 NMAX=0
      N=777
      CALL NCRT('CHO',N,NMAX)
      IF(NOP.EQ.99)GO TO 1
C   IF NOP=99 PLAY INDICATED ARRAY - OTHERWISE LIST
      NAS=MP1(75,2)
      J=1
      DO 2 I=1,NAS
      READ(7)B(1)
      IF(B(1))RETURN
      IF(I.NE.MP1(J,1))GO TO 2
      WRITE(4,*)ZA,J
      J=J+1
    2 WRITE(4,206)NME(THM1(I,1)),NUR(THM1(I,2)),TRG(THM1(I,3))
  206 FORMAT(3(1X,A3))
      WRITE(4,207)
  207 FORMAT(//)
      RETURN
C   LIST ON CRT
    3 NAS=MP1(75,2)
C   N1 REPRESENTS THE NUMBER OF NOTES.
      N1=0
      K=1
    8 IY=1000
      CALL CLEAR(.TRUE.)
      IX=300
      J=1
      DO 5 I=1,100
      N1=N1+1
      IF(N1.GT.NAS) GO TO 9
      IF(N1.NE.MP1(K,1)) GO TO 6
C   MAXIMUM OF 25 NOTES PER 'PAGE'.
      IF(I.GT.20) GO TO 7
      N=J+112
      CALL TEXT(2,N,IX,IY,7,1,BAR,ZZ,K)
C   K REPRESENTS THE NUMBER OF MOTIVES.
      J=J+1
      K=K+1
      IY=IY-25
    6 AA=NME(THM1(N1,1))
      BB=NUR(THM1(N1,2))
      CC=TRG(THM1(N1,3))
      CALL TEXT(2,N1,IX,IY,7,1,LIS,AA,BB,CC)
    5 IY=IY-22
    7 CALL TEXT(2,110,400,70,7,2,THR,NPG)
    9 CALLTEXT(2,111,70,70,7,2,FOR,EXIT)
   10 LTPEN=.FALSE.
   11 IF(LTPEN) GO TO 12
      GO TO 11
   12 IF(ITAG.LT.110) GO TO 10
      IF(ITAG.EQ.111) RETURN
C   BRING UP NEXT PAGE
      N1=N1-1
      GO TO 8
    1 NAS=MP1(75,2)
      CALL BACK(NAS,THM1)
      READ(7)B(1)
      IF(LTPEN)RETURN
      IF(B(1))RETURN
      GO TO 1
      END
