home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / nfsrc21.zip / ELAPMIL.PRG < prev    next >
Text File  |  1991-08-16  |  2KB  |  58 lines

  1. /*
  2.  * File......: ELAPMIL.PRG
  3.  * Author....: Alexander B. Spencer
  4.  * CIS ID....: 76276,1012
  5.  * Date......: $Date:   15 Aug 1991 23:03:32  $
  6.  * Revision..: $Revision:   1.2  $
  7.  * Log file..: $Logfile:   E:/nanfor/src/elapmil.prv  $
  8.  * 
  9.  * This is an original work by Alexander B. Spencer and is placed in the
  10.  * public domain.
  11.  *
  12.  * Modification history:
  13.  * ---------------------
  14.  *
  15.  * $Log:   E:/nanfor/src/elapmil.prv  $
  16.  * 
  17.  *    Rev 1.2   15 Aug 1991 23:03:32   GLENN
  18.  * Forest Belt proofread/edited/cleaned up doc
  19.  * 
  20.  *    Rev 1.1   14 Jun 1991 19:51:44   GLENN
  21.  * Minor edit to file header
  22.  * 
  23.  *    Rev 1.0   07 Jun 1991 23:39:42   GLENN
  24.  * Initial revision.
  25.  *
  26.  */
  27.  
  28.  
  29. /*  $DOC$
  30.  *  $FUNCNAME$
  31.  *     FT_ELAPMIN()
  32.  *  $CATEGORY$
  33.  *     Date/Time
  34.  *  $ONELINER$
  35.  *  Return difference, in minutes, between two mil format times.
  36.  *  $SYNTAX$
  37.  *     FT_ELAPMIN( <cTIME1>, <cTIME2> ) -> nMINUTES
  38.  *  $ARGUMENTS$
  39.  *     <cTIME1, cTIME2>  character strings of military form "hhmm",
  40.  *         where 0<=hh<24.
  41.  *  $RETURNS$
  42.  *     <nMINUTES>
  43.  *  $DESCRIPTION$
  44.  *     Finds the arithmetic difference between time two times 
  45.  *     (time 2 - time 1).
  46.  *     If time 2 is smaller than time 1, a NEGATIVE value is returned.
  47.  *  $EXAMPLES$
  48.  *     FT_ELAPMIN( "1718", "2040" ) ->  322
  49.  *     FT_ELAPMIN( "2040", "1718" ) -> -322
  50.  *  $SEEALSO$
  51.  *     FT_ELTIME() FT_MIL2MIN() FT_MIN2MIL()
  52.  *  $END$
  53.  */
  54.  
  55. function FT_ELAPMIN(cTIME1,cTIME2)
  56.   return ((VAL(LEFT(cTIME2,2))*60) + (VAL(RIGHT(cTIME2,2)))) - ;
  57.          ((VAL(LEFT(cTIME1,2))*60) + (VAL(RIGHT(cTIME1,2))))
  58.