       SUBROUTINE ISREGISTERED(CODE,N,OK)
C
C----------------------------------------------------------------------
C
C.IDENTIFICATION: Subroutine ISREGISTERED
C.LIBRARY:        PIPELIB                        
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 - 14 Jan 93 - Original version
C.PURPOSE:        test if server "code n" is registered
C.METHOD:         check content of common block
C.SYNTAX:         CALL ISREGISTERED(code,n,ok)              
C.PARAMETERS:     CHARACTER code : two letter server-type code    
C                 INTEGER   n    : 0-9 server number   
C                 LOGICAL   ok   : returns .TRUE. if registered
C.RESTRICTIONS:   
C.NOTES:          
C.FILES:          
C.REFERENCES      GET_GLOBAL_DEFAULT in GENERAL library
C
C----------------------------------------------------------------------
C                                         
       CHARACTER CODE*(*)
       INTEGER   N,I,IERR   
       LOGICAL   OK
       INCLUDE   'servers.inc' 
       EXTERNAL  BLKPIPECOMMON
       CALL GET_GLOBAL_DEFAULT('SERVERS_'//CODE,' ',PIPECOMMON_BUFFER)
       READ(PIPECOMMON_BUFFER ,*,IOSTAT=IERR)PIPECOMMON_SERVERS
       OK=.FALSE.
       PIPECOMMON_J=1
       DO 1 I=1,MAXSERVER
C      at the same time get next free slot
       IF(PIPECOMMON_SERVERS(I).NE.0.AND.I.EQ.PIPECOMMON_J)
     . PIPECOMMON_J=PIPECOMMON_J+1
       IF(PIPECOMMON_SERVERS(I).EQ.N)THEN
          OK=.TRUE.
          PIPECOMMON_I=I
       ENDIF
 1     CONTINUE
       RETURN
       END
