home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Productivity Pak 1 / rerun-productivity-pak-i.d64 / memo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  7KB  |  206 lines

  1. 5 poke53281,0:print"[158]":rem sets screen, text colors
  2. 10 dima1$(366),a2$(366),a3$(366)
  3. 15 print"[147]":fori=1to40:print"[210]";:next:fori=1to50:print" ";:next
  4. 20 print"** instant memo **";
  5. 25 fori=1to52:print" ";:next:fori=1to40:print"[146][197]";:next
  6. 30 print"[146]   select one:":z=1:print"   [163][163][163][163][163][163][163][163][163][163]"
  7. 35 printtab(5)"1[146] load old file":printtab(5)"2[146] create new file
  8. 40 [153][163]5)"3wait view calendar
  9. 45 input"";a:onagoto50,150,385
  10. 50 print"[147] from t[146]ape or d[146]isk";:inputan$:ifan$="d"then65
  11. 55 ifan$<>"t"then50
  12. 60 print"insert file tape.":open4,1,0,"memo file":goto80
  13. 65 print"insert sequential file disk.":print"press a key when ready."
  14. 70 getj$:ifj$=""then70
  15. 75 print"[147]loading file.":open4,8,8,"0:memo file,s,r"
  16. 80 ford=1to366:input#4,a1$(d):input#4,a2$(d):input#4,a3$(d)
  17. 85 ifa1$(d)="[255]"thena1$(d)=""
  18. 90 ifa2$(d)="[255]"thena2$(d)=""
  19. 95 ifa3$(d)="[255]"thena3$(d)=""
  20. 100 next:close4
  21. 105 rem main menu
  22. 110 z=0:print"[147]   select one:":print"   [163][163][163][163][163][163][163][163][163][163]"
  23. 115 printtab(5)"1[146] view the calendar
  24. 120 [153][163]5)"2wait view/add/delete a memo
  25. 125 printtab(5)"3[146] view a month
  26. 130 [153][163]5)"4wait print out a month
  27. 135 printtab(5)"5[146] save file
  28. 140 [153][163]5)"6wait end program
  29. 145 input"";t:ontgoto385,150,790,715,860,930:ift>6then145
  30. 150 m1$="":z=0:restore:print"[147] view, add or delete a memo [146]
  31. 155 [153]"(enter returnwait for menu)
  32. 160 print"(enter 'c' for calendar)":input"month (1 to 12)";m1$
  33. 165 ifm1$=""then105
  34. 170 ifm1$="c"then385
  35. 175 m1=val(m1$)
  36. 180 ifm1>12orm1<1thenprint"invalid. try again.":fori=1to1200:next:goto150
  37. 185 input"day";d1:input"year";y:y$=str$(y):iflen(y$)=5then195
  38. 190 print"use all 4 digits":goto185
  39. 195 d=int((m1-1)*30.42)-(m1=2)+(m1>2andm1<8)-(m1>2andint(y/4)*4=y)+d1
  40. 200 ify/4<>int(y/4)andd>59thend=d+1
  41. 205 fori=1to12:readmo$,mj,m,r:ifi=m1then215
  42. 210 next
  43. 215 ify/4-int(y/4)=0andd1<30then225
  44. 220 ifd1>mthenprint"not that many days in the month.":fori=1to1500:next:goto150
  45. 225 print"[147]"mo$;d1""
  46. 230 print"1[146] "+a1$(d)+chr$(13)+"2[146] "+a2$(d)+chr$(13)+"3[146] "+a3$(d)
  47. 235 print"a[146]dd, d[146]elete, n[146]ext or m[146]enu";
  48. 240 d$="":inputd$:ifd$=""then150
  49. 245 ifleft$(d$,1)="m"then105
  50. 250 ifleft$(d$,1)="n"then150
  51. 255 ifleft$(d$,1)="d"then340
  52. 260 ifleft$(d$,1)<>"a"then235
  53. 265 i1$="":i2$="":i3$="":ifa1$(d)=""then275
  54. 270 goto295
  55. 275 print"[147]"mo$;d1;"[146]":poke211,4:poke214,21
  56. 280 print"[145]enter return[146] to select new date"
  57. 285 poke211,0:poke214,6:input"[145]memo #1[157][157][157][157][157][157][157]";i1$:ifi1$<>""thena1$(d)=i1$
  58. 290 ifi1$=""then150
  59. 295 ifa2$(d)=""then305
  60. 300 goto315
  61. 305 input"memo #2[157][157][157][157][157][157][157]";i2$:ifi2$<>""thena2$(d)=i2$
  62. 310 ifi2$=""then150
  63. 315 ifa3$(d)=""then325
  64. 320 print"this date full. d[146]elete, n[146]ext, or":print"m[146]enu";:goto240
  65. 325 input"memo #3[157][157][157][157][157][157][157]";i3$:ifi3$<>""thena3$(d)=i3$
  66. 330 ifi3$=""then150
  67. 335 goto320
  68. 340 print"which memo":input"(1,2,3, or n[146]one)";x$
  69. 345 ifx$="1"thena1$(d)="":goto225
  70. 350 ifx$="2"thena2$(d)="":goto225
  71. 355 ifx$="3"thena3$(d)="":goto225
  72. 360 ifleft$(x$,1)="n"then105
  73. 365 c=y1-yb:ifc=1800orc=2200orc=2600orc=3000thencc=0:return
  74. 370 ifc=1700orc=2100orc=2500orc=2900thencc=2:return
  75. 375 ifc=2000orc=2400orc=2800thencc=4:return
  76. 380 ifc=1900orc=2300orc=2700thencc=5:return
  77. 385 print"[147] display a calendar [146]"
  78. 390 restore:input"what month (1 to 12)  ";mo
  79. 395 ifmo>12then385
  80. 400 input"year";y1:yr$=str$(y1):s=0
  81. 405 iflen(yr$)<>5thenprint"enter all 4 digits.":goto400
  82. 410 ify1<1700thenprint"i can't go that far   into the past.":goto400
  83. 415 ify1>3099thenprint"i can't go that far   into the future.":goto400
  84. 420 fori=1to12:readmo$,mj,m,r:ifi=mothen430
  85. 425 next
  86. 430 rem compute where 1st day falls
  87. 435 ify1/4=int(y1/4)then640
  88. 440 bb$=str$(y1):yb=val(right$(bb$,2)):gosub365
  89. 445 yy=(int(yb*10/8)+(cc+1+r))/7:vv=yy-int(yy)
  90. 450 ifvv<.15andvv>.13thens=0
  91. 455 ifvv<.30andvv>.28thens=5
  92. 460 ifvv<.44andvv>.42thens=10
  93. 465 ifvv<.58andvv>.56thens=15
  94. 470 ifvv<.72andvv>.70thens=20
  95. 475 ifvv<.87andvv>.85thens=25
  96. 480 ifvv=0thens=30
  97. 485 rem calendar heading
  98. 490 print"[147]"tab(13)mo$;y1
  99. 495 print"  sun  mon  tue  wed  thu  fri  sat  [146]"
  100. 500 rem poke dates on screen
  101. 505 n=1146:c=55418:nn=49:e=mj+1:a=128:fore=etoe+8:poken+s,nn:pokec+s,7
  102. 510 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s,nn+a:pokec+s,7
  103. 515 gosub665:nn=nn+1:next:nn=48:e=mj+10:fore=etoe+9:poken+s,49:pokec+s,7
  104. 520 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s,177:pokec+s,7
  105. 525 poken+s+1,nn:pokec+s+1,7
  106. 530 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s+1,nn+a:pokec+s+1,7
  107. 535 gosub665:nn=nn+1:next
  108. 540 e=mj+20:nn=48:fore=etoe+8:poken+s,50:pokec+s,7
  109. 545 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s,178:pokec+s,7
  110. 550 poken+s+1,nn:pokec+s+1,7
  111. 555 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s+1,nn+a:pokec+s+1,7
  112. 560 gosub665:nn=nn+1:next:ifm=28then675
  113. 565 e=mj+29:poken+s,50:pokec+s,7
  114. 570 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s,178:pokec+s,7
  115. 575 poken+s+1,57:pokec+s+1,7
  116. 580 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s+1,185:pokec+s+1,7
  117. 585 gosub665:ifm=29then675
  118. 590 e=mj+30:poken+s,51:pokec+s,7
  119. 595 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s,179:pokec+s,7
  120. 600 poken+s+1,48:pokec+s+1,7
  121. 605 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s+1,176:pokec+s+1,7
  122. 610 gosub665:ifm=30then675
  123. 615 e=mj+31:poken+s,51:pokec+s,7
  124. 620 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s,179:pokec+s,7
  125. 625 poken+s+1,49:pokec+s+1,7
  126. 630 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenpoken+s+1,177:pokec+s+1,7
  127. 635 gosub665:goto675
  128. 640 ify1/100<>int(y1/100)then650
  129. 645 ify1/400<>int(y1/400)then440
  130. 650 ifmo=1thenm=31:r=r-1:goto440
  131. 655 ifmo=2thenm=29:r=r-1:goto440
  132. 660 goto440
  133. 665 s=s+5:ifn+s=1181orn+s=1301orn+s=1421orn+s=1541orn+s=1661thens=s+85
  134. 670 return
  135. 675 poke211,7:poke214,21:print"[145] press return for menu  "
  136. 680 ifz<>1thenprinttab(7)"press f1 to enter memo  [146]
  137. 685 [153][163]7)"press f7 for screen dumpwait
  138. 690 getj$:ifj$=""then690
  139. 695 ifasc(j$)=133then150
  140. 700 ifasc(j$)=136then940
  141. 705 ifz=1then15
  142. 710 goto105
  143. 715 restore:print"[147]print out a month [146]
  144. 720 [133]"what month (1 to 12)";mo
  145. 725 [129]i[178]1[164]12:[135]mo$,mj,m,r:[139]i[178]mo[167]735
  146. 730 [130]
  147. 735 [153]"turn on printer.":[153]"hit a key when ready.
  148. 740 print"press return[146] to return to menu.
  149. 745 [161]j$:[139]j$[178]""[167]745
  150. 750 [139]j$[178][199](13)[167]105
  151. 755 [159]4,4:[152]4,[199](14)"memos for ";mo$:[152]4,[199](15):e[178]mj[170]1:f[178]1
  152. 760 [129]e[178]e[164]e[170]m[171]1
  153. 765 [139]a1$(e)[179][177]""[176]a2$(e)[179][177]""[176]a3$(e)[179][177]""[167][152]4:[152]4,mo$;f;"--"
  154. 770 [139]a1$(e)[179][177]""[167][152]4,"  * "[170]a1$(e)
  155. 775 [139]a2$(e)[179][177]""[167][152]4,"  * "[170]a2$(e)
  156. 780 [139]a3$(e)[179][177]""[167][152]4,"  * "[170]a3$(e)
  157. 785 f[178]f[170]1:[130]:[129]i[178]1[164]4:[152]4:[130]:[160]4:[137]105
  158. 790 [140]:[153]"loadview a month wait
  159. 795 input"what month (1 to 12)";mo
  160. 800 fori=1to12:readmo$,mj,m,r:ifi=mothen810
  161. 805 next
  162. 810 g=0:e=mj+1:f=1:ifm=28thenm=29
  163. 815 print"[147]":fore=etoe+m-1
  164. 820 ifa1$(e)<>""ora2$(e)<>""ora3$(e)<>""thenprint""mo$;f"[146]":print:g=1
  165. 825 ifa1$(e)<>""thenprint" "+a1$(e)
  166. 830 ifa2$(e)<>""thenprint" "+a2$(e)
  167. 835 ifa3$(e)<>""thenprint" "+a3$(e)
  168. 840 f=f+1:ifg=0then855
  169. 845 print""tab(9)"hit any key to proceed[146]":g=0
  170. 850 getj$:ifj$=""then850
  171. 855 print"[147]":next:goto105
  172. 860 print"[147]save file [146]
  173. 865 [153]" save to twaitape or dwaitisk";:[133]an$:[139]an$[178]"d"[167]880
  174. 870 [139]an$[179][177]"t"[167]860
  175. 875 [153]"insert file tape.":[159]4,1,1,"memo file":[137]900
  176. 880 [153]"insert sequential file disk.":[153]"press a key when ready."
  177. 885 [161]j$:[139]j$[178]""[167]885
  178. 890 [153]"loadsaving file.":[159]15,8,15:[152]15,"s0:memo file"
  179. 895 [160]15:[159]4,8,8,"0:memo file,s,w"
  180. 900 [129]d[178]1[164]366:[139]a1$(d)[178]""[167]a1$(d)[178]"(NULL)"
  181. 905 [152]4,a1$(d):[139]a2$(d)[178]""[167]a2$(d)[178]"(NULL)"
  182. 910 [152]4,a2$(d):[139]a3$(d)[178]""[167]a3$(d)[178]"(NULL)"
  183. 915 [152]4,a3$(d):[130]
  184. 920 [153]"one more minute, please."
  185. 925 [152]