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