Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Sundays
Message
 
To
12/04/2000 13:09:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00358746
Message ID:
00358816
Views:
11
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 && Sunday
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform