home *** CD-ROM | disk | FTP | other *** search
-
- * LEAPTST.PRG, by Robert C. Ashcraft
- * Demonstrates use of ISLEAP() Function
- * Clipper 5.0 and Clipper Summer 87 tested.
- CLEAR
- ? "Enter a YEAR (Between 100 - 2999) ..."
- ? "(Press ENTER alone to Exit)"
- ?
- DO WHILE .T.
- ACCEPT "> " TO mt
- IF EMPTY(mt)
- RETURN
- ENDIF
- IF VAL(mt)>99 .AND. VAL(mt)<3000
- ?? ">",mt,"is" + ;
- IIF(IsLeap(CTOD("01/01/"+mt)),""," NOT"),"a Leap Year."
- ENDIF
- ENDDO
- *
- * FUNCTION IsLeap(date)
- * Return .T. if date is in a leap year, .F. if not
- *
- FUNCTION IsLeap
- PARAMETERS md
- RETURN !EMPTY(CTOD("02/29/"+ALLTRIM(STR(YEAR(md)))))
- * EOF
-
-