      SUBROUTINE S6(NUMB,NCD,ITAG)
      CHARACTER*60 G1(1),G2(1),G3(1)
      COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
      COMMON/AR/BRAY(4,600),STRESS(200,4)
      COMMON/SIHI/IVECT(1800)
      G1(1)='(''PUSH BUTTON (1),PROCEED'')'
      G2(1)='(''PUSH BUTTON (2), OUT OF ORDER'')'
      G3(1)='(''PUSH BUTTON (3),RETURN TO MAIN/L.'')'
      LCS=1
      N=0
    1 N=N+1
      U=BRAY(1,N)
      V=BRAY(2,N)
      CALL S4(U,V)
    3 CONTINUE
      CALL S0(L)
      CALL TEXT(2,23,0,1000,7,1,G1)
      CALL TEXT(2,24,0,0950,7,1,G2)
      CALL TEXT(2,25,0,0900,7,1,G3)
      GO TO (4,5,6),L
    5 IF(N.LT.40)GO TO 1
    4 CONTINUE
      IF(N.LT.40)GO TO 8
      WRITE(4,9)
    9 FORMAT(1X,28HMORE THAN 40 POINTS IN TRACK)
    8 CONTINUE
      X=BRAY(1,LCS)
      Y=BRAY(2,LCS)
      BRAY(1,LCS)=U
      BRAY(2,LCS)=V
      BRAY(1,N)=X
      BRAY(2,N)=Y
      N=LCS
      NCD=N
      LCS=N+1
      IF(NCD.LT.2) GO TO 7
      ITAG=6
      CALL DISPLY(3,ITAG)
      IR=1
      NUMB=NCD
      L1=3
      CALL S3(L1,NUMB,NCD)
    7 CALL VECTOR(1,BRAY,1,NCD,IVECT,IR,LA,0,FALSE)
      CALLDISPLY(6,ITAG,IVECT,IR,LA)
      GO TO 1
    6 CONTINUE
      RETURN
      END
