C   ---------------------------------------------------------------------------
C   TIMEGET - The function of this routine is to find the next character
C	string from the time calculation line and return pointers to the First 
C	and Last characters of the string.
C
C	The delimiters are:
C
C		end of string
C		'('
C		')'
C
C	Beginning and trailing blanks will not be returned.
C
C   ---------------------------------------------------------------------------
C
	INTEGER*4 FUNCTION TIMEGET ( STRING, S1, S2 )
C
	IMPLICIT INTEGER*4 (A-Z)
C
	EXTERNAL	SS$_NORMAL
C
	PARAMETER	OPEN_P='('
	PARAMETER	CLOSE_P=')'
	PARAMETER	BLANK=' '
C
	CHARACTER	STRING*(*)
C
	INTEGER*4	S1, S2, TMP
	INTEGER*4	STRING_S
C
C   ---------------------------------------------------------------------------
C
C   Initialize the return code.
C
	TIMEGET = %LOC(SS$_NORMAL)
C
C   Find the beginning of the string.
C
	STRING_S = LEN( STRING )
C
	S1 = S2 + 1
	TMP = LIB$SKPC ( BLANK, STRING(S1:STRING_S) ) + (S1-1)
	IF ( TMP .EQ. (S1-1) ) THEN
		TIMEGET = 0
		GOTO 999
	END IF
	S1 = TMP
C
C   Find the end of the string.
C
	TMP = INDEX( STRING(S1:STRING_S), OPEN_P ) + (S1-1)
	IF ( TMP .NE. (S1-1) .AND. TMP .NE. S1 ) THEN
		S2 = TMP - 1
	ELSE
		TMP = INDEX( STRING(S1:STRING_S), CLOSE_P ) + (S1-1)
		IF ( TMP .NE. (S1-1) ) THEN
			S2 = TMP
		ELSE
			S2 = STRING_S
		ENDIF
	ENDIF
C
C   Remove trailing blanks from the string.
C
	STATUS = STR$TRIM( STRING(S1:S2), STRING(S1:S2), TMP )
	S2 = TMP + (S1-1)
C
C   Return
C
999	CONTINUE
	RETURN
	END
