rem 12/13/86 common used for terminal characteristics common today$,warm$,trmtyp$,clear$,bell$,clreol$ common escape$,poscmd$,posofs%,rowcol$ rem - program NOTEBOOK.BAS rem - action planning notebook rem - Copyright 1982, by Peter C. Hawxhurst rem - revised 12/25/1982 rem - variable tabulation ************************ rem act$ = action on file rem action$ = action planning entry rem cat$ = file category rem category$ = action planning categories rem cmnd$ = input command rem count% = counter rem i% = for next loop counter rem item$ = number of action plan item rem line% = line counter rem q$ = simple recover input rem ren% = file rename value rem s1 = no category switch rem s2 = end switch rem s3 = category/plan input switch rem s4 = category/action found switch rem ucat$ = uppercase category for comparison rem - program structure ************************** %chain 100,10000,50,500 gosub 100 : rem - housekeeping gosub 200 : rem - screen gosub 300 : rem - category 10 gosub 400 : rem - command if s2=0 then 10 20 print clear$ chain "HANDYSYS.COM" 100 rem - housekeeping subroutine **************** dim actx$(50) dim actionx$(50) dim catx$(25) dim categoryx$(25) dim ucatx$(25) if end #1 then 110 open "NOTETYPE.DAT" as 1 goto 120 110 create "NOTETYPE.DAT" as 1 create "NOTEBOOK.DAT" as 2 close 2 print clear$ print "NOTE:" print print "No notebook/log categories exist currently." print "At least one (1) category must be added in" print "order for noting or loging to be initiated." print "A total of 24 categories may be utilized." print "Category descriptions should be limited to" print "twenty (20) characters each." print input "Please press - RETURN >";line q$ s1=1 120 close 1 return 200 rem - screen subroutine ********************** print clear$ print tab(15);" NOTEBOOK / LOG" print ypos%=19:xpos%=1:gosub 15000:rem - cursor for i%=1 to 49:print "-";:next i%:print print "(A)dd (D)elete (E)xit (R)estart (S)can" return 300 rem - category subroutine ******************** ypos%=4:xpos%=1:gosub 14000:rem-rubout xpos%=15:gosub 15000:rem - cursor print "Notation Categories" if s1=1 then 330 ypos%=6:xpos%=1 for i%=1 to 12 gosub 14000 : rem - rubout ypos%=ypos%+1 next i% open "NOTETYPE.DAT" as 1 ypos%=6:xpos%=1 310 if end #1 then 320 read #1;category$ gosub 15000 : rem - cursor print category$ ypos%=ypos%+1 if ypos%=18 then xpos%=27 if ypos%=18 then ypos%=6 goto 310 320 close 1 330 return 400 rem - command subroutine ********************* 410 print bell$; ypos%=20:xpos%=41:gosub 15000 : rem - cursor print "> "; while not constat%:wend:cmnd$=ucase$(chr$(conchar%)) if cmnd$="" then 410 if cmnd$="A" and s3=0 then gosub 500 : rem - add category if cmnd$="A" and s3=1 then gosub 600 : rem - add action if cmnd$="A" then 420 if cmnd$="D" and s3=0 then gosub 700 : rem - delete category if cmnd$="D" and s3=1 then gosub 800 : rem - delete action if cmnd$="D" then 420 if cmnd$="E" then s2=1 if cmnd$="E" then 420 if cmnd$="R" and s3=0 then gosub 14000 : rem - rubout if cmnd$="R" and s3=0 then 410 if cmnd$="R" and s3=1 then gosub 900 : rem - restart if cmnd$="R" then 420 if cmnd$="S" and s3=1 then gosub 1100 : rem - continue if cmnd$="S" and s3=0 then gosub 1000 : rem - scan if cmnd$="S" then 420 goto 410 420 return 500 rem - add category subroutine **************** gosub 14000 : rem - rubout 510 ypos%=22:xpos%=1:gosub 15000 : rem - cursor input "Category description >";line category$ if category$="" then print bell$ if category$="" then 510 if len(category$)<21 then 520 gosub 14000 : rem - rubout print bell$; gosub 15000 : rem - cursor input "Input too long - press RETURN >";line q$ gosub 14000 : rem - rubout :goto 510 520 open "NOTETYPE.DAT" as 1 530 if end #1 then 540 read #1;cat$ goto 530 540 print #1;category$ close 1 s1=0 gosub 14000 : rem - rubout gosub 300 : rem - category return 600 rem - add action subroutine ****************** 610 gosub 14000 : rem - rubout open "NOTEBOOK.DAT" as 1 ypos%=22:xpos%=1:gosub 15000: rem - cursor input "Notation >";line action$ if action$="" then print bell$; if action$="" then 610 if len(action$)<50 then 620 gosub 14000:gosub 15000 print bell$; input "Input too long - press RETURN >";line q$ goto 610 620 if end #1 then 630 read #1;cat$,act$ goto 620 630 print #1;category$,action$ close 1 gosub 14000 : rem - rubout gosub 1000 : rem - scan return 700 rem - delete category subroutine ************* s4=0 710 gosub 14000 : rem - rubout ypos%=22:xpos%=1:gosub 15000:rem - cursor input "Category to delete >";line category$ if category$="" then print bell$; if category$="" then 710 category$=ucase$(category$) gosub 14000:gosub 15000 print "Deleting category from categories file..." open "NOTETYPE.DAT" as 1 create "TRANS" as 2 720 if end # 1 then 730 read #1;cat$ ucat$=ucase$(cat$) if category$=ucat$ then s4=1 if category$=ucat$ then 720 print #2;cat$ goto 720 730 if s4=1 then 740 gosub 14000:gosub 15000 print bell$; input "Category not found - press RETURN >";line q$ 740 delete 1 close 2 ren%=rename("NOTETYPE.DAT","TRANS") if s4=0 then 770 gosub 14000:gosub 15000 print "Deleting notations for category..." open "NOTEBOOK.DAT" as 1 create "TRANS" as 2 750 if end #1 then 760 read #1;cat$,action$ ucat$=ucase$(cat$) if category$=ucat$ then 750 print #2;cat$,action$ goto 750 760 delete 1 close 2 ren%=rename("NOTEBOOK.DAT","TRANS") 770 gosub 14000 : rem - rubout gosub 300 : rem - category return 800 rem - delete action subroutine *************** s4=0:count%=0 810 gosub 14000 : rem - rubout ypos%=22:xpos%=1:gosub 15000:rem - cursor input "Number of item to delete >";line item$ if item$="" then print bell$; if item$="" then 810 x$=item$:gosub 11000:rem - numeric check if e1>0 then print bell$; if e1>0 then 810 if val(item$)<>int(val(item$)) then print bell$; if val(item$)<>int(val(item$)) then 810 open "NOTEBOOK.DAT" as 1 create "TRANS" as 2 820 if end #1 then 850 read #1;cat$,act$ cat$=ucase$(cat$) if cat$=ucat$ then 840 830 print #2;cat$,act$ goto 820 840 count%=count%+1 if count%=val(item$) then s4=1 if count%=val(item$) then 820 goto 830 850 if s4=1 then 860 gosub 14000:gosub 15000 print bell$; input "Item not found - press RETURN >";line q$ 860 delete 1 close 2 ren%=rename("NOTEBOOK.DAT","TRANS") gosub 14000 : rem - rubout gosub 1000 : rem - scan return 900 rem - restart subroutine ********************* gosub 14000 : rem - rubout s3=0 gosub 300 : rem - category return 1000 rem - scan subroutine *********************** s3=1:s4=0:s5=0:count%=0:line%=0 if cmnd$="A" then 1015 if cmnd$="D" then 1015 1010 gosub 14000 : rem - rubout ypos%=22:xpos%=1:gosub 15000:rem - cursor input "Category to scan >";line category$ if category$="" then print bell$; if category$="" then 1010 ucat$=ucase$(category$) gosub 14000 : rem - rubout 1015 ypos%=6:xpos%=1:gosub 15000:rem - cursor for i%=1 to 12 gosub 14000:ypos%=ypos%+1 next i% open "NOTEBOOK.DAT" as 1 ypos%=4:xpos%=1:gosub 14000:rem - cursor print gosub 15000 print "Short notes on "; print category$ print ypos%=6 1020 count%=count%+1 1030 if end #1 then 1050 read #1;cat$,act$ cat$=ucase$(cat$) if cat$=ucat$ then 1040 goto 1030 1040 gosub 15000 print using "###";count%;:print " ";act$ line%=line%+1 if line%=12 then 1050 ypos%=ypos%+1 goto 1020 1050 close 1 hold$=act$ return 1100 rem - continue subroutine ******************* gosub 14000 : rem - rubout ypos%=6:xpos%=1 for i%=1 to 12:gosub 14000:ypos%=ypos%+1:next i% ypos%=6 open "NOTEBOOK.DAT" as 1 1110 read #1;cat$,act$ if act$=hold$ then 1120 goto 1110 1120 line%=0 gosub 1020 return 11000 rem - numeric check subroutine *************** 11010 rem 11020 rem - variables to check 11030 rem e1 = error switch 11040 rem i% = for/next loop counter 11050 rem x = numeric position counter 11060 rem y = decimal point locator 11070 rem z = numeric position match counter 11080 rem 11090 e1=0:x=0:y=0:z=0:y=match(".",x$,1) 11100 for i%=1 to len(x$):z=z+i%:next i% 11110 if y=0 then 11130 11120 z=z+1 11130 for i%=1 to len(x$):x=x+match("#",x$,i%):next i% 11140 if x=z then 11160 11150 e1=1 11160 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