10 function integer utl_day_of_week (return_day$,day0%, day1%) 900 external integer function sys$asctim & \ external integer constant ss$_normal & \ map (quad) a0%, a1% & 1000 if ((day0% = 0%) and (day1% = 0%)) & then & t$ = string$(23%,0%) & \ sts% = sys$asctim(,t$,,) & \ goto 19000 if sts% <> ss$_normal & else & t$ = string$(23%,0%) & \ a0% = day0% & \ a1% = day1% & \ sts% = sys$asctim(,t$,a0%,) & \ PRINT T$ & \ goto 19000 if sts% <> ss$_normal & 1010 hyphen% = pos(t$,"-",1%) & \ day% = val%(left(t$,hyphen%-1%)) & \ month$ = seg$(t$,hyphen%, hyphen% + 3%) & \ year% = val%(seg$(t$,hyphen% + 5%, hyphen% + 9%)) & \ month% = pos("-JAN-FEB-MAR-APR-MAY-JUN-JUL-AUG-SEP-OCT-NOV-DEC", & month$, 1%)/4% + 1% & \ if month% <= 2% & then & year% = year% - 1% & \ month% = month% + 1% & 1020 a% = 36525%*year%/100% + 306%*(month%+1%)/10% + day% - 621049% & \ d% = (a% - (a%/7%)*7%)*3% & \ day$ = seg$("SUNMONTUEWEDTHUFRISAT",d%+1%,d%+3%) & \ return_day$ = day$ & \ utl_day_of_week = ss$_normal & \ goto 32767 & 19000 utl_day_of_week = sts% & 32767 functionend