SUBROUTINE ASKSTR(PROMPT, STRING) C C Prompt standard input for a string, and return that string. C If just is pressed, the passed string is not changed. CHARACTER*(*) PROMPT,STRING C INTEGER STRLEN CHARACTER*80 TMPSTR C STRLEN = LEN(STRING) DO WHILE(STRING(STRLEN:STRLEN) .EQ. ' ') IF (STRLEN .EQ. 1) GOTO 150 STRLEN = STRLEN - 1 END DO 150 CONTINUE cdrc TYPE 10,PROMPT,STRING(1:STRLEN) PRINT 10,PROMPT,STRING(1:STRLEN) 10 FORMAT(1X,A,' [',A,']: ',$) READ(*,'(A)') TMPSTR IF (TMPSTR .NE. ' ') THEN STRING = TMPSTR END IF C RETURN END