home *** CD-ROM | disk | FTP | other *** search
- /*********
- * TSTOM
- * by Tom Rettig
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * Syntax: TSTOM( <expC> )
- * Return: Numeric minutes from <expC> time string.
- * Zero if invalid time string format.
- *********/
-
- #include "trlib.h"
-
- TRTYPE tstom()
- {
- char *instr;
- double ret;
- if ( PCOUNT == 1 && ISCHAR(1) )
- {
- instr = _parc(1);
- if ( VALIDTIME(instr) )
- {
- ret = (double)
- ( (ADTOL(instr[HOURS])*36000) +
- (ADTOL(instr[HOUR ])* 3600) +
- (ADTOL(instr[MINS ])* 600) +
- (ADTOL(instr[MIN ])* 60) +
- (ADTOL(instr[SECS ])* 10) +
- ADTOL(instr[SEC ]) ) / 60;
- _retnd( ret );
- }
- else
- _retnd( (double)ERROR );
- }
- else
- _retnd( (double)ERROR );
- }
-
-