rem 12/13/86 common used for terminal characteristics common today$,warm$,trmtyp$,clear$,bell$,clreol$ common escape$,poscmd$,posofs%,rowcol$ rem - program REMINDER.BAS rem - monthly date reminder rem - copyright 1982, by Peter C. Hawxhurst rem - revised 11/28/1982 rem - revised for KAYPRO 03/02/84 rem - variable tabulation ************************ rem cmnd$ = user commands rem d1 = prior date check value rem d2 = post date check value rem d3 = date check value rem d$ = date read from file rem d1$ = prior date for check rem d2$ = post date for check rem datex$ = date for add transaction rem e$ = event read from file rem e1$ = prior event for check rem e2$ = post event for check rem event$ = items to be posted rem found$ = record found switch rem i% = for/next loop counter rem line% = line counter rem month$ = month for reminder listing rem occur$ = date items occur rem pdatex$ = date for posting rem ren = file rename value rem q$ = continue input rem s1 = end switch rem s2 = headings switch rem today$ = today's date rem warm$ = menu warm boot switch rem - program structure ************************** %chain 100,10000,50,500 gosub 100 : rem - housekeeping 10 if s1=1 then 20 gosub 200 : rem - process goto 10 20 print clear$ chain "HANDYSYS.COM" 100 rem - housekeeping subroutine **************** pdatex$=today$ if end #1 then 110 open "REMINDER.DAT" as 1 goto 120 110 create "REMINDER.DAT" as 1 120 close 1 return 200 rem - process subroutine ********************* if s2=1 then 210 gosub 300 : rem - heading gosub 400 : rem - subscreen gosub 500 : rem - post s2=1 210 gosub 600 : rem - input if cmnd$="A" then gosub 700 : rem - add if cmnd$="A" then 230 if cmnd$="D" then gosub 800 : rem - delete if cmnd$="D" then 230 if cmnd$="F" then gosub 900 : rem - forward if cmnd$="F" then 230 if cmnd$="R" then gosub 1000 : rem - restart if cmnd$="R" then 230 if cmnd$="E" then 220 print bell$:goto 210 220 s1=1 230 return 300 rem - heading subroutine ********************* print clear$ print tab(17);"MONTHLY REMINDER" print tab(24);"for" for i%=1 to val(left$(today$,2)):read month$:next i% restore print tab(21);month$;", ";right$(today$,4) return 400 rem - subscreen subroutine ******************* ypos%=19:xpos%=1:gosub 15000 : rem - cursor for i%=1 to 49:print "-";:next i%:print print "(A)dd (D)elete (E)xit (F)orward (R)estart" return 500 rem - post subroutine ************************ ypos%=6:xpos%=5:gosub 15000 : rem - cursor open "REMINDER.DAT" as 1 510 if end #1 then 540 read #1;occur$,event$ if val(left$(occur$,2))=val(left$(pdatex$,2)) then 520 goto 510 520 print left$(occur$,5);" ";event$ line%=line%+1 if line%<12 then 530 print bell$ ypos%=22:xpos%=1:gosub 15000 : rem - cursor input "Press - RETURN - to continue >";line q$ gosub 14000 : rem - rubout gosub 1100 : rem - clear 1 line%=0 ypos%=6:xpos%=5:gosub 15000 : rem - cursor goto 510 530 ypos%=ypos%+1:gosub 15000:goto 510 540 close 1 line%=0 return 600 rem - input subroutine *********************** 610 print bell$ ypos%=20:xpos%=43:gosub 15000 : rem - cursor print "> "; while not constat%:wend:cmnd$=ucase$(chr$(conchar%)) if cmnd$="" then gosub 14000:goto 610 return 700 rem - add subroutine ************************* ypos%=20:xpos%=43:gosub 14000 : rem - rubout 710 ypos%=22:xpos%=1: gosub 15000 : rem - cursor input "Date of item to be added (MM/DD/YYYY) >";line datex$ if datex$="" then gosub 14000 if datex$="" then 710 if datex$=escape$ then 740 gosub 10000 : rem - date check if e1=0 then 720 print bell$:gosub 14000:goto 710 720 gosub 14000:gosub 15000 input "Event description >";line event$ if event$="" then 720 if event$=escape$ then 740 if len(event$)<35 then 730 print bell$:gosub 14000:gosub 15000 input "35 characters maximum; press - RETURN >";line q$ goto 720 730 gosub 1200 : rem - transaction 740 gosub 14000 :rem - rubout gosub 1100 : rem - clear 1 gosub 500 : rem - post return 800 rem - delete subroutine ********************** found$="no" ypos%=20:xpos%=43:gosub 14000:rem - rubout 805 ypos%=22:xpos%=1:gosub 15000 :rem - cursor print "Enter description of event to delete below..." input ">";line event$ if event$="" then gosub 14000 if event$="" then 805 if event$=escape$ then 845 event$=ucase$(event$) open "REMINDER.DAT" as 1 create "TRANS" as 2 810 if end #1 then 830 read #1;d$,e$ e1$=ucase$(e$) if e1$<>event$ then 820 found$="yes" goto 810 820 print #2;d$,e$ goto 810 830 if found$="yes" then 840 print bell$ ypos%=22:xpos%=1:gosub 14000:rem - rubout ypos%=23:gosub 14000:gosub 15000 input "Entry not found - press RETURN >";line q$ gosub 14000:rem - rubout goto 850 840 delete 1 close 2 ren%=rename("REMINDER.DAT","TRANS") 845 ypos%=22:xpos%=1:gosub 14000:rem - rubout ypos%=23:gosub 14000 gosub 1100:rem - clear 1 gosub 500:rem - post 850 return 900 rem - forward subroutine ********************* ypos%=20:xpos%=43:gosub 14000:rem - cursor ndatex$=str$(val(left$(pdatex$,2))+1)+"/01/"+right$(pdatex$,4) if val(left$(ndatex$,2))<13 then 910 ndatex$="01/01/"+str$(val(right$(pdatex$,4))+1) 910 pdatex$=ndatex$ gosub 1100:rem - clear 1 ypos%=4:xpos%=1:gosub 14000 : rem - rubout for i%=1 to val(left$(pdatex$,2)) read month$ next i% restore print tab(27);month$;", ";right$(pdatex$,4) gosub 500 :rem - post return 1000 rem - restart subroutine ******************** ypos%=20:xpos%=43:gosub 14000:rem - rubout pdatex$=today$ gosub 1100: rem - clear 1 ypos%=4:xpos%=1:gosub 14000 : rem - rubout for i%=1 to val(left$(pdatex$,2)) read month$ next i% restore print tab(27);month$;", ";right$(pdatex$,4) gosub 500 : rem - post return 1100 rem - clear 1 subroutine ******************** ypos%=6:xpos%=1:gosub 15000 : rem - cursor for i%=1 to 12:print clreol$:next i% return 1200 rem - transaction subroutine **************** d1$="00/00/0000" open "REMINDER.DAT" as 1 create "TRANS" as 2 1210 if end #1 then 1280 read #1;d2$,e2$ d1=val(left$(d1$,2))*100+val(mid$(d1$,4,2)) d2=val(left$(d2$,2))*100+val(mid$(d2$,4,2)) d3=val(left$(datex$,2))*100+val(mid$(datex$,4,2)) if d3>=d1 and d3<=d2 then 1220 print #2;d2$,e2$ d1$=d2$:e1$=e2$ goto 1210 1220 print #2;datex$,event$ 1230 print #2;d2$,e2$ if end #1 then 1290 read #1;d2$,e2$ goto 1230 1280 print #2;datex$,event$ 1290 delete 1 close 2 ren%=rename("REMINDER.DAT","TRANS") return rem - month data ********************************* data "JAN","FEB","MAR","APR","MAY","JUN" data "JUL","AUG","SEP","OCT","NOV","DEC" 10000 rem - date check subroutine ****************** 10010 rem 10020 rem - variables to check 10030 rem datex$ = date being checked 10040 rem e1 = error switch 10050 rem i% = for/next loop counter 10060 rem p$ = substitute for date to be checked 10070 rem p1$ = month 10080 rem p2$ = day 10090 rem p3$ = year 10100 rem x = numeric counter 10110 rem 10120 e1=0 10130 p$=datex$ 10140 if len(p$)>10 then 10340 10150 x=0 10160 for i%=1 to 10:x=x+match("#",p$,i%):next i% 10170 if x<>57 then 10340 10180 p1$=left$(p$,2):p2$=mid$(p$,4,2):p3$=right$(p$,4) 10190 if val(p1$)<1 then 10340 10200 if val(p1$)>12 then 10340 10210 if val(p2$)<1 then 10340 10220 if val(p3$)<1 then 10340 10230 if val(p1$)<>int(val(p1$)) then 10340 10240 if val(p2$)<>int(val(p2$)) then 10340 10250 if val(p3$)<>int(val(p3$)) then 10340 10260 if val(p1$)=9 and val(p2$)>30 then 10340 10270 if val(p1$)=4 and val(p2$)>30 then 10340 10280 if val(p1$)=6 and val(p2$)>30 then 10340 10290 if val(p1$)=11 and val(p2$)>30 then 10340 10300 if val(p1$)=2 and val(p2$)>29 then 10340 10310 if val(p3$)/4=int(val(p3$)/4) then 10350 10320 if val(p1$)=2 and val(p2$)>28 then 10340 10330 goto 10350 10340 let e1=1 10350 return 14000 rem - rubout subroutine ******************** 14010 gosub 15000 14020 print clreol$; 14030 return 15000 rem - cursor subroutine ******************** 15020 rem - variables to check 15030 rem xpos% = horizontal cursor position (1-52, L to R) 15040 rem ypos% = vertical cursor position (1-24, T to B) 15060 if rowcol$=chr$(01) then 15090 15070 print poscmd$+chr$(xpos%+posofs%-1)+chr$(ypos%+posofs%-1); 15080 go to 15100 15090 print poscmd$+chr$(ypos%+posofs%-1)+chr$(xpos%+posofs%-1); 15100 return