Files
sics/difrac/keyget.f
2000-02-07 10:38:55 +00:00

28 lines
890 B
Fortran
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
C-----------------------------------------------------------------------
C Function KEYSIN -- MS Fortran specific
C-----------------------------------------------------------------------
INTEGER FUNCTION KEYSIN (STRING)
CHARACTER STRING*(*)
C-----------------------------------------------------------------------
C Do some housekeeping
C-----------------------------------------------------------------------
MAX = LEN(STRING)
STRING = ' '
INDEX = 0
C-----------------------------------------------------------------------
C Loop until we get nothing back
C-----------------------------------------------------------------------
10 IC = KEYIN ()
IF (IC .NE. 0) THEN
INDEX = INDEX + 1
STRING(INDEX:INDEX) = CHAR(IC)
IF (INDEX .GE. MAX) THEN
KEYSIN = MAX
RETURN
ENDIF
GO TO 10
ENDIF
KEYSIN = INDEX
RETURN
END