home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
xbase
/
library
/
clipper
/
rettig
/
source
/
_tr_isds.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-21
|
630b
|
30 lines
/*********
*
* _TR_ISDS.C
*
* by Tom Rettig
*
* Placed in the public domain by Tom Rettig Associates, 10/22/1990.
*
* Syntax: _tr_isdsvalid( <date string> )
* Return: TRUE if <date string> is a valid date, otherwise FALSE
* Note : <date string> is *char in the DTOS() format "YYYYMMDD"
********/
#include "trlib.h"
int _tr_isdsvalid(ds)
char *ds;
{
if ( ISDS(ds) ) /* ds is in date string format */
{
/* _tr_ldm() returns zero if invalid month or year */
return( DSDAY(ds) >= 1 && DSDAY(ds) <= _tr_ldm(DSMONTH(ds),DSYEAR(ds)) );
}
else
return( FALSE );
}