
                               					22-Feb-1982 20:04:38	VAX-11 FORTRAN V2.4-64              Page   1
								22-Feb-1982 20:03:27	_DRA0:[USER]DEL2ABS.FOR;14                  

0001    	IMPLICIT INTEGER(A-B,D-K,M-Y),LOGICAL(L),CHARACTER*10(C)
0002    	INTEGER*4   int_delay(2), int_time(2), int_out(2)
0003    	CHARACTER   delay1*20,cur_time*23,time_out*23,time_to_go*23
0004    	character   out_mess*60, ret_var*32, input_line*64
0005    	data ret_var /' abs_time '/
0006    	data delay1 /'0 1:0:0.0'/
0007    	integer*2   time_len, cur_len, del_len
0008    	integer*2   ib1, ib2, ilen /0/
        c
        c  Parameters:
        c    command parameter line -- 
        c	first field must be a dcl Global symbol name to receive the value
        c	second field contains an optional VMS delta time specification
        c
        C---
        C  Get the input delta time 
        C---
0009    	status = lib$get_foreign(input_line,'Delta time: ',input_len)
0010    	if( input_len.lt.1 ) then
0011    	  status = lib$put_output('No symbol name/delta time was supplied')
0012    	  call exit(1)
0013    	endif
        c---
        c  get the symbol name and see if time was supplied
        c---
0014    	status = str$trim(input_line,input_line,ilen)
0015    	ib1 = lib$index(input_line(1:ilen),' ')
0016    	  ret_var = input_line(:ib1)
0017    	if( ib1.gt.0 ) then
0018    		time_to_go = input_line(ib1+1:ilen)
0019    	 else
0020    		status = lib$put_output('No delta time was supplied')
0021    	 	call exit(1)
0022    	 endif
        c---
        c  see if day field was provided
        c---
0023    	status = str$trim(time_to_go,time_to_go,time_len)
0024    	ib1 = lib$index(time_to_go(:time_len),' ')
0025    	if( ib1.eq.0 ) then
0026    	  icol = lib$index(time_to_go(:time_len),':')
0027    	  if( icol.gt.0 )  then
0028    		time_out = '0 '//time_to_go(:time_len)
0029    		time_to_go = time_out(:2+time_len)
0030    	  endif
0031    	endif
        d	type *,input_line
        d	type *,ret_var
        d	type *,time_to_go
        c---
        C  get the current time
        C---
0032    	status = sys$bintim('-- ::',int_time)
        C---

DEL2ABS$MAIN                   					22-Feb-1982 20:04:38	VAX-11 FORTRAN V2.4-64              Page   2
								22-Feb-1982 20:03:27	_DRA0:[USER]DEL2ABS.FOR;14                  

        C  Convert the delta time to internal format
        C---
0033    	status = sys$bintim(time_to_go(1:time_len),int_delay)
0034    	if( status ) goto 100
0035    	 stat2 = lib$sys_getmsg(status,,out_mess)
0036    	 call lib$put_output(out_mess)
0037    	 call exit(1)
0038    100	continue
0039    900	format(2(x,z8))
        C---
        C  subtract the delta time from the current time to get target time
        C---
0040    	call subquad(int_time,int_delay,int_out)
        C---
        C  convert the result back to ascii format
        C---
0041    	status = sys$asctim(time_len,time_out,int_out,)
0042    	ib1    = index(time_out,' ')
0043    	time_out(ib1:1) = ':'
        C---
        C  set the output symbol to the target time
        C---
0044    	call lib$do_command(ret_var//' :== '//time_out)
0045    	end	




PROGRAM SECTIONS

    Name				 Bytes   Attributes

  0 $CODE                                  420   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG
  1 $PDATA                                  98   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG
  2 $LOCAL                                 616   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG


ENTRY POINTS

    Address  Type  Name          

  0-00000000       DEL2ABS$MAIN  


VARIABLES

    Address  Type  Name              Address  Type  Name              Address  Type  Name              Address  Type  Name          

  2-00000110  I*2  CUR_LEN         2-0000002C  CHAR CUR_TIME        2-00000018  CHAR DELAY1          2-00000112  I*2  DEL_LEN       
  2-00000114  I*2  IB1             2-00000116  I*2  IB2             2-00000124  I*4  ICOL            2-00000118  I*2  ILEN          
  2-00000120  I*4  INPUT_LEN       2-000000CD  CHAR INPUT_LINE      2-00000071  CHAR OUT_MESS        2-000000AD  CHAR RET_VAR       
  2-00000128  I*4  STAT2           2-0000011C  I*4  STATUS          2-0000010E  I*2  TIME_LEN        2-00000043  CHAR TIME_OUT      
  2-0000005A  CHAR TIME_TO_GO    

DEL2ABS$MAIN                   					22-Feb-1982 20:04:38	VAX-11 FORTRAN V2.4-64              Page   3
								22-Feb-1982 20:03:27	_DRA0:[USER]DEL2ABS.FOR;14                  

ARRAYS

    Address  Type  Name                Bytes  Dimensions

  2-00000000  I*4  INT_DELAY               8  (2)
  2-00000010  I*4  INT_OUT                 8  (2)
  2-00000008  I*4  INT_TIME                8  (2)


LABELS

    Address   Label       Address   Label   

  0-0000012F  100           **      900'    


FUNCTIONS AND SUBROUTINES REFERENCED

FOR$EXIT_W                       LIB$DO_COMMAND                   LIB$GET_FOREIGN                  LIB$INDEX                        
LIB$PUT_OUTPUT                   LIB$SYS_GETMSG                   STR$TRIM                         SUBQUAD                          
SYS$ASCTIM                       SYS$BINTIM                       


Total Space Allocated = 1134 Bytes


COMMAND QUALIFIERS

  FORTRAN /LIST DEL2ABS

  /CHECK=(NOBOUNDS,OVERFLOW)
  /DEBUG=(NOSYMBOLS,TRACEBACK)
  /F77  /NOG_FLOATING  /I4  /OPTIMIZE  /WARNINGS  /NOD_LINES  /NOMACHINE_CODE  /CONTINUATIONS=19


COMPILATION STATISTICS

  Run Time:           1.64 seconds
  Elapsed Time:       2.02 seconds
  Page Faults:        394
  Dynamic Memory:     68 pages
