>
>procedure checkforleap (tdate as date) as boolean
> * Find february of that year
> lddate = ctod("02/01"+str(year(tdate)))
>
> * Find the number of days in Feburary
> lidays = day(date(year(lddate),month(gomonth(lddate,1)),1)-1)
>
>return lidays = 29
>
>
>You could make it more compact, but I feel it gets too cryptic.
But it's doing some extra steps, which you can remove without making it (IMHO) less readable.
In the first line, if you start by finding March 1st instead of February 1st, you don't need the GOMONTH() in the second line.
Also, why is the first line using slower CTOD() instead of DATE()? Instead of CTOD("02/01/"+STR(YEAR(tdate))), I'd use DATE(YEAR(tddate)),03,01).
As if you wanted my US$.02 ... *g*
Rich Addison, Micro Vane, Inc., Kalamazoo, MI
Relax, don't worry, have a homebrew.
- Charlie Papazian, The New Complete Joy of Home Brewing