C***********************************************************************
C
C  THIS SUBROUTINE WILL DISPLAY A STAR ON THE SCREEN AND ENABLE THE USER
C  TO MOVE IT AROUND WITH THE LIGHT PEN.  WHEN A BUTTON (1-10) IS
C  PRESSED THE COORDINATES OF THE STAR'S POSITION ARE RETURNED TO THE
C  MAIN PROGRAM.  ADDITIONAL STATEMENTS HAVE BEEN ADDED SO THAT IF THE
C  STAR IS POSITIONED OVER A LINE THAT IS ALREADY BEING DISPLAYED, THEN
C  THE TAG OF THIS LINE WILL ALSO BE RETURNED TO THE MAIN PROGRAM.
C
C***********************************************************************
      SUBROUTINE STAR(IX,IY,KT)
      INTEGER JV(19)                                                            
      LOGICAL BINT,LP
      COMMON /SPEN/NUM,IIX,IIY,BINT,LP,IT
C                                            DATA FOR DISPLAY OF STAR.
      DATA JV(1),JV(2),JV(6),JV(10),JV(14)/0,4*14415/                           
      DATA JV(3),JV(4),JV(5)/74228,34242,-65436/                                
      DATA JV(7),JV(8),JV(9)/74178,34292,-39936/                                
      DATA JV(11),JV(12),JV(13)/74178,34242,-39836/                             
      DATA JV(15),JV(16),JV(17)/74178,34342,-39708/                             
      DATA JV(18),JV(19)/57344,0/                                               
C                                            KT SET TO NO TAG VALUE.
      KT=-1
C                                            INITIALISE FN. BOX VAR.
      NUM=-1
C                                            DISPLAY STAR IN LATEST
C                                            POSITION.
    1 CALL CRT(6,9999,JV,1,19)                                                  
C                                            WAIT FOR INTERRUPT
      LP=.FALSE.
    3 IF(.NOT.LP)GO TO 4
C                                            REPOSITION STAR
      IX=IIX                                                                    
      IY=IIY                                                                    
      IF(IX.LT.50)IX=50                                                         
      IF(IY.LT.50)IY=50                                                         
      IF(IX.GT.973)IX=973                                                       
      IF(IY.GT.973)IY=973                                                       
      JV(3)=73728+IY                                                            
      JV(4)=33742+IX                                                            
      JV(7)=73678+IY                                                            
      JV(8)=33792+IX                                                            
      JV(11)=73678+IY                                                           
      JV(12)=33742+IX                                                           
      JV(15)=73678+IY                                                           
      JV(16)=33842+IX                                                           
C                                             DELETE OLD STAR
      CALL CRT(3,9999)                                                          
C                                             CHECK IF BUTTON PUSHED
      IF(NUM.EQ.-1)GO TO 1
      GO TO 5
    4 IF(NUM.EQ.-1)GO TO 3
      CALL CRT(3,9999)
C                                            WAIT A WHILE TO SEE
C                                            IF ANOTHER TAG IS PICKED UP
    5 DO 2 I=1,100
    2 CONTINUE
C                                            IF IT IS, COLLECT VALUE.
      IF(IT.NE.9999)KT=IT
C                                            THEN RETURN.
      RETURN
      END
