lparameters tnMonth, tnYear >>ldStart=ctod("^"+str(tnYear,4)+"/"+padl(int(tnMonth),2,"0")+"/"+"01") >>ldEndDay = gomonth(ldStartDay,1)-day(gomonth(ldStartDay,1)) >>for ix = 0 to day(ldEndDay) >> ? ldStart+ix, dow(ldStart+ix,2) = 7 && Sunday >>endforCetin
LPARAMETER tmonth, tyear > >LOCAL lddate, lndow >* Get the first day of the month >lddate = DATE(tyear, tmonth, 1) >* Get its DOW() Making sure 1 = Sunday and 7 = Saturday >lndow = DOW(lddate, 1) >* Get the first Sunday, if it isn't >IF lndow # 1 > lddate = lddate + (8 - lndow) >ENDIF >DO WHILE MONTH(lddate) = tmonth > ? lddate > lddate = lddate + 7 >ENDDO
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 endforI intentionally prevent date(Y, M, D) for older versions.