llIsLeap = NOT EMPTY(CTOD("2/29/" + STR(YEAR(tdate), 4, 0)))>works, but the format would have to be adjusted for date formats
*------------------ FUNCTION IsLeapYear *------------------ Parameters txParm * * Returns .T. if year is a leap year, otherwise returns .F. * * This syntax is for FoxPro 2.x * private lcYear, lcSetDate, lcCentury, llLeapYear lcSetDate = set("date") lcCentury = set("century") set date american && so CTOD will work as expected. set century on && ditto. do case case type( "txParm") = "C" lcYear = ALLTRIM( txParm) case type( "txParm") = "N" lcYear = ALLTRIM( STR( txParm)) case type( "txParm") = "D" if !empty( YEAR( txParm)) && If we got a valid date lcYear = ALLTRIM( STR( YEAR( txParm))) && then capture its year. else && Otherwise if we got an invalid date then force lcYear = "X" && '!empty( CTOD( "02/29/" + lcYear))' to be .F. endif endcase if type("lcYear") = "C" && .T. if parameter was type C, N, or D llLeapYear = !empty( CTOD( "02/29/" + lcYear)) else && if parameter was not type C, N, or D ??chr(7) wait window nowait ; "Parameter must be character, numeric, or date." llLeapYear = .F. endif set date &lcSetDate set century &lcCentury RETURN llLeapYear *ENDFUNC IsLeapYear()