Hidy Cetin,
>IOW you're blaming me for unneccesiraly looping the whole month day by day :-) Well I now code my "other" thought :)
Naw, I'm not "blaming" you. It works, that's what's important.:-)
>
lparameters tnMonth, tnYear
>ldStart=ctod("^"+str(tnYear,4)+"/"+padl(int(tnMonth),2,"0")+"/"+"01")
>ldEndDay = gomonth(ldStartDay,1)-day(gomonth(ldStartDay,1))
>IF dow(ldStart,1) # 1
> lddate = dow(ldStart,1) + (8 - dow(ldStart,1))
>ENDIF
>for ix = day(lddate)-1 to day(ldEndDay-1) step 7
> ? ldStart+ix, dow(ldStart+ix,2) = 7
>endfor
I intentionally prevent date(Y, M, D) for older versions.
>PS: This is just to reply to your voice my friend.
Your's is probably a bit faster because of the FOR...ENDFOR. However, I don't understand
lddate = dow(ldStart,1) + (8 - dow(ldStart,1)) after the IF statement. Typo?
As far as the DATE() issue, I don't use any previous versions of VFP, and have gotten out of the habit of trying to remember what applies to what version. It's just gotten to be too much of a burden trying to keep in mind things that I personally don't have to worry about< s >.
George
Ubi caritas et amor, deus ibi est