home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1987 January & February / rerun-1987-01-02.d64 / calendar (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  55 lines

  1. 5 poke53280,0:poke53281,0:print"[155][147]"
  2. 10 dimnd(12),mo$(12):open4,4
  3. 15 t$="    ----------------------------------------------------------------   "
  4. 20 c$="[200]        ":t$="     "+t$
  5. 25 forlo=1to12:readnd(lo),mo$(lo):nextlo
  6. 30 forll=1to7:readdy$:aa$=aa$+"      "+dy$:next
  7. 35 d=1:mo=1:yr=2000
  8. 40 gosub200
  9. 45 input"month & year (mm,yyyy)";mo,yr
  10. 50 gosub120
  11. 55 xx=(nd(mo)+j)/7:nu=int(xx):ifxx>nuthennu=nu+1
  12. 60 if (yr/4)-int(yr/4)=0 then nd(2)=29
  13. 65 sr=(j*10)+4
  14. 70 gosub300
  15. 75 clr:input"again (y/n)";xz$:ifxz$="y"thenrun
  16. 80 close4
  17. 85 end
  18. 90 gosub300
  19. 95 end
  20. 99 rem day#
  21. 100 data 31,january,28,february,31,march,30,april,31,may,30,june,31,july,31
  22. 105 data august,30,september,31,october,30,november,31,december
  23. 110 data sun,mon,tue,wed,thu,fri,sat
  24. 120 q=yr+(mo<3):j=int(275*mo/9)-int((7*q+7)/4)+367*yr+d-int((int(q/100)+1)*3/4)
  25. 125 j=j-4-7*int((j-4)/7):return
  26. 130 return
  27. 135 data sun,mon,tue,wed,thu,fri,sat
  28. 200 print"[147]":printspc(10)"* calendar generator *":print
  29. 210 print"   input any month in two (2) digit form and any year in four (4)";
  30. 215 print" digit form. a  calendar for that month and year will   be dumped";
  31. 220 print" to the printer."
  32. 225 print:print:print"    [158]turn on printer now![155] "
  33. 230 print:print:print"    hit any key to continue"
  34. 235 getg$:ifg$=""then235
  35. 240 return
  36. 300 ce=(64-len(mo$(mo))*2-12)/2+9:print#4:print#4,spc(ce)chr$(14);mo$(mo)+" ";yr
  37. 305 print#4,chr$(15):print#4
  38. 310 in=4:gu=0:n9$="01":n9=1
  39. 315 print#4,spc(7)aa$
  40. 320 print#4,t$
  41. 325 forlo=1tonu
  42. 330 print#4,"         ";
  43. 335 forl3=1to7
  44. 340 in=in+9:ifin>=srthengu=1
  45. 345 ifn9>nd(mo)thengu=0
  46. 350 ifgu=0then360
  47. 355 print#4,left$(c$,7);right$(n9$,2);:n9=n9+1:n9$="0"+mid$(str$(n9),2):goto365
  48. 360 print#4,c$;
  49. 365 nextl3:print#4,"[200]"
  50. 370 forl2=2to8
  51. 375 print#4,"         ";c$;c$;c$;c$;c$;c$;c$;"[200]":nextl2
  52. 380 print#4,t$
  53. 385 nextlo:print#4,chr$(12)
  54. 390 return
  55.