07-27-2006, 10:52 AM
Moneo: The date routine has one minor flaw, that other posters in the thread checked for.
I would check for Len(Z$) <> 8 first, because this would indicate a bad date.
One entry that passes your check is 200002228 even though it is 9 chars.
Otherwise, great job.
I would probably do this for the day and month check, it appears more logical to me, it took me a while to figure yours out.
I would check for Len(Z$) <> 8 first, because this would indicate a bad date.
One entry that passes your check is 200002228 even though it is 9 chars.
Otherwise, great job.
I would probably do this for the day and month check, it appears more logical to me, it took me a while to figure yours out.
Code:
IF ZMM < 1 OR ZMM > 12 THEN RETURN
IF ZDD < 1 OR ZDD > (ZMO(ZMM) - ((ZMM = 2) AND ISLEAPYEAR(ZYY))) THEN RETURN