*****screen_man rutine************
	
	SUBROUTINE CLS		! brisanje ekrana & cursor home

	CHARACTER*1 CSI

	CSI=CHAR(155)
	PRINT 220,CSI,CSI
220	FORMAT($,A1,'2J',A1,'H')
	RETURN
	END


	SUBROUTINE INPI(PROMPT,I)

	CHARACTER*(*) PROMPT

	PRINT 100, PROMPT
100	FORMAT($,A) 
	READ(*,*) I
	RETURN
	END


	SUBROUTINE INPR(PROMPT,R)

	CHARACTER*(*) PROMPT

	PRINT 100, PROMPT
100	FORMAT($,A) 
	READ(*,*) R
	RETURN
	END


	SUBROUTINE INPC(PROMPT,STRING)

	CHARACTER*(*) PROMPT
	CHARACTER*(*) STRING

	PRINT 100, PROMPT
100	FORMAT($,A) 
	READ '(A)', STRING 
	RETURN
	END


	SUBROUTINE INPCL(PROMPT,STRING,L)

	CHARACTER*(*) PROMPT
	CHARACTER*(*) STRING
	INTEGER L

	PRINT 100, PROMPT
100	FORMAT($,A) 
	READ '(Q,A)', L, STRING 
	RETURN
	END
 

	SUBROUTINE SPACES_OFF(TT,LENG)
	
	CHARACTER*(*) TT
	INTEGER LENG
	LOGICAL Q
	
	DO I=1,LEN(TT)
	   IF(TT(1:1).EQ.' ') THEN
	      TT=TT(2:LEN(TT))
	   ENDIF
	ENDDO
	
	Q=.TRUE.
	LENG=0
	DO I=LEN(TT),1,-1
	   IF(TT(I:I).NE.' '.AND.Q) THEN
	      LENG=I
	      Q=.FALSE.
	   ENDIF
	ENDDO
	
	RETURN
	END

      
      SUBROUTINE SUB_STRING(TT,SS,L)

! gets substring SS, shifts string TT left removing SS from it
! delimiters are SPs or TABs

      CHARACTER*(*) TT, SS      ! string, substring
      INTEGER L                 ! LEN of substring

      LT=LEN(TT)
      I=1
      DO WHILE(TT(I:I).EQ.' '.OR.TT(I:I).EQ.CHAR(9))
         I=I+1
         IF(I.GT.LT) THEN
            L=0
            SS=' '
            TT=' '
            RETURN
         ENDIF
      ENDDO
      I1=I
      DO WHILE(.NOT.(TT(I:I).EQ.' '.OR.TT(I:I).EQ.CHAR(9)))
         I=I+1
         IF(I.GT.LT) EXIT
      ENDDO
      I2=I-1
      L=I2-I1+1
      IF(L.EQ.0) THEN
         SS=' '
      ELSE
         SS=TT(I1:I2)
      ENDIF
      IF(I.GT.LT) THEN
         TT=' '
      ELSE
         TT=TT(I:LT)
      ENDIF
      RETURN
      END



	SUBROUTINE CTRLS2SP(STRING)

	CHARACTER*(*) STRING

	DO I=1,LEN(STRING)
	   II=ICHAR(STRING(I:I))
	   IF(II.LT.32.OR.II.GT.127) STRING(I:I)=' '
	ENDDO
	RETURN
	END
