home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
tstom.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-21
|
890b
|
38 lines
/*********
* 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 );
}