This function returns the day of the week of the 1st day in a month, and the number of days in that month.
DEF MONTHINFO YEAR,MONTH OUT FIRSTDAY,DAYS
DTREAD FORMAT$(FIRST$,YEAR,MONTH) OUT ,,,FIRSTDAY
IF MONTH>12 THEN
DTREAD FORMAT$(FIRST$,YEAR,MONTH) OUT ,,,NEXTFIRSTDAY
DAYS=(NEXTFIRSTDAY-FIRSTDAY+7) MOD 7 +28