SUBROUTINE TIMEPARSE(time,delta_time) IMPLICIT INTEGER(A-Z) parameter CLI$_PRESENT_G = '0003FD19'X parameter CLI$_PRESENT_L = '0003FD31'X INTEGER*4 sys$position, beg_pos, end_pos, colon_pos, run_lth INTEGER*4 cli$present, cli$get_value, icode, hour, minute CHARACTER run_time*10, time*5, run_input*10 LOGICAL delta_time C C Get RUN_TIME information from the Command Language Interface. C icode = cli$present('RUN_TIME') if (icode) then do while (cli$get_value('RUN_TIME', run_input)) icode = str$trim(run_time,run_input,run_lth) enddo else time = ' ' delta_time = .FALSE. goto 1000 end if C C Parse through string and check for valid times. C beg_pos = 1 if (run_time(1:1).EQ.'+') beg_pos = 2 end_pos = str$position(run_time(1:LEN(run_time)),' ') end_pos = end_pos - 1 if (end_pos.GT.6) STOP '%TIMEPARSE-F-HOUR Invalid time selected!' colon_pos = str$position(run_time(1:LEN(run_time)),':') if (colon_pos.EQ.0) then colon_pos = end_pos read(run_time(beg_pos:end_pos),300,err=999) hour minute = 0 else read(run_time(beg_pos:colon_pos-1),300,err=999) hour read(run_time(colon_pos+1:end_pos),300,err=999) minute 300 format(I2) end if !Hour/minute colon check. if (hour.GT.23) STOP '%TIMEPARSE-F-HOUR Invalid time selected!' if (minute.GT.59) STOP '%TIMEPARSE-F-MIN Invalid time selected!' C C Check to see if time requested is a delta. C if (beg_pos.EQ.2) delta_time = .TRUE. C C C time = run_time(beg_pos:end_pos) goto 1000 999 continue STOP '%TIMEPARSE-F-CNVRT Invalid date/time parsed!' 1000 continue return end