>Is it possible to test whether the .day portion of a date object is
>a particular day of the week, say "Sunday"? Something like the code
>below, (which doesn't work)?
>
>set gTheFullDate_RPF_date = date(20010606)
>put gTheFullDate_RPF_date.day = "Sunday"
There are routines that let you calculate the day of any date since
when the calendars were changed from Julian to Gregorian (which was
at different times in different countries). The routines are not too
hard to follow, but I wouldn't bother.
Instead, take any day you know, say Jan 3rd 1904, which was a Sunday.
Now subtract that from any date you want, and mod 7 it. That will
give you one less than the date's day:
put (the systemdate - date(1904,1,3)) mod 7
-- 3
3+1 is 4, making today Wednesday.
The whole function could read like this:
on getdayname thedate
return item (((thedate - date(1904,1,3)) mod 7)+1) of
"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday"
end
I've tried it, it works nicely.
--
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]