        SUBROUTINE X_PROMPT(string,k)                                
C
C----------------------------------------------------------------------
C
C.IDENTIFICATION: Subroutine X_PROMPT                  A
C.LIBRARY:        GENERAL (SO FAR this is NOT a VOS routine !!!)
C                 perhaprs it should be moved to VOS library ....
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 - 22 May 92 - Test version
C                 0.1 -  4 Sep 92 - kill trailing blanks
C.VERSIONS:       1.0 - 29 Oct 92 - New error handling codes
C.PURPOSE:        issue prompt to terminal if echo enabled; also does
C                 some tabulation if k > 2
C.METHOD:         Fortran WRITE to std out with $ format
C.SYNTAX:         CALL X_PROMPT(string,k)                             
C.PARAMETERS:     CHARACTER string : the prompt                   
C                 INTEGER   k      : columns where to start output
C.RESTRICTIONS:   
C.NOTES:          this is a very prelimnary routine, does not do all
C                 the wonderful things required by Morini ...
C                 also there is no error handling
C.FILES:          none
C.REFERENCES      GET_GLOBAL_DEFAULT in GENERAL library 
C
C----------------------------------------------------------------------
C
C      INCLUDE       'implicit_none.inc'
       CHARACTER*(*) STRING
       INTEGER       K,I,TRUE_LENGTH
       CHARACTER     XECHO*3,FORMAT*24
       INCLUDE       'voscommon.inc'
       INCLUDE       'errors.inc'
C
C      is echo enabled ? 
       CALL GET_GLOBAL_DEFAULT('ECHO','ON',XECHO)
       IF(XECHO.NE.'ON')RETURN
C
C      in principle this shall split the prompt on more than
C      one line according to terminal width (needs a VOS way to
C      retrieve terminal width) ... but we forget about that now
C
C-->   the $ format works in VMS and Unix ... if another system
C      will not support it .. the routine has to be moved to the
C      VOS library  
C
       IF (K.LE.2)THEN
          FORMAT='(''  '',A,'' '',$)'
       ELSE
          WRITE(FORMAT,1,IOSTAT=VOSCOMMON_SYSTEMERROR)K
 1        FORMAT('(''  '',A,T',I2.2,''' '',$)')
       ENDIF
C      try to leave just one blank at the end
       I=TRUE_LENGTH(STRING)+1
       I=MIN(I,LEN(STRING))
       WRITE(*,FORMAT,IOSTAT=VOSCOMMON_SYSTEMERROR)STRING(1:I)
       IF(VOSCOMMON_SYSTEMERROR.NE.0)VOSCOMMON_ERROR=XE_TWRITERR
       RETURN
       END
