# LOGGER (c) Ian Summers Oct 88 set of (:lg: 2set H<mx%=40:Dr$=":RAM.2/LOG/":O%=18.5*3600:O$="^": personalisation items A*NAME LOGGER Nn$ = "END" er("Enter RUN "+a$+225+" at '>' prompt"): e "Log will "checkex(Nn$)" '"B$Dr$Nn$B$"'": "Do you wish to change the log file name (Y/N)";an$  an$ = "END"  an$ <> "y" an$ <> "Y" 3 nn= new=(Dr$+Nn$):ld$="NEW":EX%=#new:#new 2ss(ld$,Nn$,tm,AP$,AC$,):ls:nn= EX%=0 ze::"Calculating...":F=(Dr$+Fn$):0,2)"Finding end of file ";::EX%=#F:#F,TEST$:20,2)EX%;:#F TEST$="*END*":TEST$<>"*END*"EX%=#F #F: ݤdy:dy$=$:=dy$,1,dy$-10) Y"ݤtm:tm$=‘$,8):hr%=(tm$,2)):mn%=(tm$,4,2)):sc%=(tm$,2)):=sc%+(mn%+(hr%*60))*60 >,ݤrt:t%=tm%(24*3600):hr%=t% 3600:mn%=(t%-hr%*3600) 60 6sc%=(t%-hr%*60) 60 @ hr%<10 tm$="0" tm$="" Jtm$=tm$+hr%+":" Tmn%<10 tm$=tm$+"0" ^tm$=tm$+mn%+":" hsc%<10 tm$=tm$+"0" rtm$=tm$+sc%:=tm$ x|ݤHR(tm%):hrs%=tm%3600:T$=(hrs%):T$=4-T$," ")+T$+":":mn%=(tm%-hrs%*3600)/60:mn%<10T$=T$+"0"+(mn%)T$=T$+(mn%) =T$ ݤdate(dy$):p%=0::p%=p%+1:dy$,p%,1)=" ":q%=p%::q%=q%+1:dy$,q%,1)>"9":q%=q%-1:r%=q%+3::r%=r%+1:dy$,r%,1)=" ":s%=r%+1 R:s%=s%+1:dy$,s%,1)=",":dy%=(dy$,p%+1,q%-p%)):mh$=dy$,q%+4,r%-q%-4):mh%=0 }:mh%=mh%+1:mh$=M$(mh%):yr%=(dy$,r%+1,s%-r%-1))-1988:an%=yr%*365+D%(mh%-1)+dy%-1:an%=an%+yr%4:mh%<3yr%4=0an%=an%-1 =an% Jlg: nn : S$"Last session... "S$B$ld$" "tm$B$" "R$AP$R$" "B$AC$B$' ::tm$=rt: R$S$" "st$S$R$B$ld$" "tm$B$" "R$AP$R$" "B$AC$B$13,1)R$S$" Menu "R$S$13,2)R$" B "R$" will cause a break in logging"13)R$" C "R$" will clear "lf$'R$S$;  " Log file "R$S$3R$" E "R$" to edit the last few entries of "lf$'13R$" P "R$" will print "lf$'R$S$" Time "R$S$7R$S$"ESC"R$S$" to start a new log"'13R$" Select from menu or press any other key to log change in "; - "application/activity "R$C$0,5)S$Fn$S$ :G=(0):G>0G=G &5F ftm%=tm:S$0,7)rt S$;:G>0:0,8)C$: G = ("B") st$="Break in... "::log("*BREAK*","<",): G=("C")clear: G=("P")pr: G=("E")ed: <NP$=new("Application ",R$+AP$+R$,9): NP$ = "END" : -NT$=new("Activity"+5," "),B$+AC$+B$,42) &NT$ = "END" : 0 NP$ <> "" AP$=NP$ : NT$ <> "" AC$=NT$ ND AP$="" AC$="" :er("You must enter an application and activity"): .Nst$="Logging... "::log(AP$,AC$,fg):: Xݤnew(ty$,df$,ln%):: 'ty$"(DEFAULT="df$") up to "ln%" characters"'ln%+2,".")"<"a$225ln%+6,8);:new$:new$>ln%7: :=new$ bed:::PN%=60-1:tm%=SC%(PN%)(24*3600):R$" "PN%+1" "R$;:AP$(PN%)<>""S$DY$(PN%)38)rt,5)S$" "R$AP$(PN%)R$" "B$AC$(PN%)B$ l:R$" Enter the number to edit an entry or "a$225" to make changes and return to main menu "R$" ";::G=:"1234567"+13,G) vG=13:Re: ŀ0,7)80;:G=G-49:::R$3S$DY$(G%)" "S$R$:tm%=SC%(G):R$" A "R$rt,5)'R$" B "R$AP$(G)'R$" C "R$AC$(G)'R$" Which attribute of the entry do you want to change ("a$225" for no changes) "R$" "; (:H=:H-64>0H-64<4H=13:H=13: H-64t^B,dPB,dxB tm%=tm:'R$" Currently "rt,5)" "R$" How many minutes do you want to add to time (use '-' to take away) ";: MN%:SS%=SC%(G)+MN%*60 mSS%0SS%>SC%(G-1)7R$" You cannot move the time to after that of the next entry "R$" Press a key":: yG=0SS%>date(dy+",")*24*3600+tm 7R$" You cannot move the time to after the current time "R$" Press a key":: SC%(G)=SS%: ANP$=new("New application ",R$+AP$(G)+R$,9):NP$=""NP$=AP$(G) NP$="END" G=0AP$<>""AP$=NP$ AP$(G)=NP$: ?NT$=new("New activity ",B$+AC$(G)+B$,42):NT$=""NT$=AC$(G) NT$="END"  G=0AP$<>""AC$=NT$ AC$(G)=NT$:: : Re:ts(400):PO%=7:PO%=PO%-1:PO%=-1 PO%(PO%)>-1 *PO%=-1 :4CD$=DY$(PO%+1):F=(Dr$+Fn$):#F=PO%(PO%):PN%=PO%0-1 >AP$(PN%)=""DfC HPO%(PN%)=#F 1RDY$(PN%)<>CD$#F=0CD$=DY$(PN%):#F,DY$(PN%) -\#F,(SC%(PN%)):#F,AP$(PN%):#F,AC$(PN%) f:EX%=#F:#F,"*END*":#F: kpts(sz%)::S$"Calculating..."S$;:F=(Dr$+"Dummy"):DZ%=1sz%/2:#F,"T"::#F:"*ERASE "+Dr$+"Dummy": Vzlog(ap$,ac$,fg):ts(100):F=(Dr$+Fn$): F=0 er("Log file has dissappeared"): #F=EX%:EP%=#F:dy$=dy  dy$<>ld$ #F,dy$ ld$=dy$:tm%=date(dy$+",")*24*3600+tm:#F,(tm%):#F,ap$:#F,ac$:EX%=#F:#F,"*END*":#F:ss(dy$,Fn$,tm%,ap$,ac$,fg):PN%=60-1 iDY$(PN%+1)=DY$(PN%):SC%(PN%+1)=SC%(PN%):AP$(PN%+1)=AP$(PN%):AC$(PN%+1)=AC$(PN%):PO%(PN%+1)=PO%(PN%): <DY$(0)=dy$:SC%(0)=tm%:AP$(0)=ap$:AC$(0)=ac$:PO%(0)=EP%: ss(dy$,Fn$,tm%,ap$,ac$,fg) fg= ap$=AP$:ac$=AC$ F=(Dr$+"Control") 5 F=0 er("Log control file has dissapeared"): <#F,Fn$:#F,dy$:#F,(tm%):#F,ap$:#F,ac$:#F,st$:#F: cݤcheckex(F$):ex=(Dr$+F$): ex nn=:EX%=#ex:#ex:="be added to the "+B$+"existing"+B$+" file" 5nn=:#ex:= "begin a "+B$+"new"+B$+" file called" clear:: "Do you really want to clear "lf$" "B$Fn$B$" (Y/N)";: an$: an$ = "Y" an$ = "y" clearf er("File "+Fn$+" still intact!"): 2ld$="Cleared":ss(ld$,Fn$,tm,AP$,AC$,):ze: dze:AP$="":AC$="":PN%=07:DY$(PN%)="":SC%(PN%)=0:AP$(PN%)="":AC$(PN%)="":PO%(PN%)=-1::EX%=0: Gclearf:C%=(Dr$+Fn$):#C%:er("Log file "+B$+Fn$+B$+" cleared"): $pr::S$"Calculating..."S$:ts(30):tm%=date(dy$+",")*24*3600+tm:F=(Dr$+Fn$):#F=EX%:#F,"*END*":#F,(tm%):#F,"*PRINT*":#F:F=(Dr$+Fn$):P%=0:B%=0::X%=0mx%:T%(X%)=0: .:rd:".";:N%=:P%>0s >8N%P%=P%+1:A$(P%)=A$:W%=T%-U%:T%(B%)=T%(B%)+W%:U%=T%:B%=P% B#F:#F:dp: 4Lrd:d$=D$:#F,D$: (D$)=0 #F,T$ T$=D$:D$=d$ ?VD$="*END*"T%=(T$):#F,D$:#F:D$=d$:A$="*PRINT*":Y$="": `#F,A$,Y$:T%=(T$): Ejs:X%=1P%:A$=A$(X%)W%=T%-U%:T%(B%)=T%(B%)+W%:U%=T%:B%=X%:N%= Dt:N%P%=mx%er("Too many applications: increase mx% (line 60)") ~ 'dp:P%=0 er("No log found"): pOU=(Dr$+Fn$+"L"):#OU,"%OP%BM4":#OU,"%OP%LM4":#OU,"%OP%HE/LOGGER %H4%(C) Ian Summers 1988%H4%//Page @P@/" #OU,"%OP%FO/"+Fn$+"L//@D@/":#OU,"%CO:A,72,72%%C%%H2%Log of file: "+Fn$+"%H2%":#OU:tt%=0:X%=1P%:A$(X%),1)="*"T%(X%)<60dbD Rtt%=tt%+T%(X%):ld$="NEW":#OU," "::F=(Dr$+Fn$):rd:U%=T%:AO$=A$:CO$=Y$::rd AD$<>ld$AO$=A$(X%)#OU," "+" "+IP$+D$+IP$:" "S$D$S$:ld$=D$ U%86400>O%V$=O$V$=" " hAO$=A$(X%)T%-U%>59tm%=U%:OU$=rt,5)+" "+AO$+10-AO$," ")+HR(T%-U%)+V$+3," ")+CO$:OU$:#OU,OU$ kAO$=A$:CO$=Y$:U%=T%:#F:#F:OU$=6," ")+A$(X%)+10-A$(X%)," ")+HR(T%(X%))+4," ")+"TOTAL (hrs:mins)" B$OU$B$:#OU,PB$+OU$+PB$ 1:LL$="Total hours for "+Fn$+" are "+HR(tt%) 5'B$LL$B$':LL$=PB$+LL$+PB$:#OU," ":#OU,LL$:#OU "To print the log - go into a blank PipeDream application and enter:"'10)B$a$43"FL"Dr$Fn$"L "a$22510)a$43"PO "B$a$225' > "Print of "Fn$" finished - Press a key to continue":: K er(er$):: Z$er$F$''"Press a key to continue"F$;::0,2)300,1): nr:er("Device "+Dr$+" nearly full"+gp$+"Last action has not been carried out"+gp$+"Create some room using FILER before continuing"): : ( E(B) 2 Cambridge Computer Ltd < B=0 FA=":RAM.0/EE.CLI" PB$=":RAM.0/E.CLI" Z#A,".>"+B$ d#A,".J","LIST"+(B),"PROCF" n#A x*CLI .*:RAM.0/EE.CLI   F A=(0) A= B$ #A,A$,A$ #A A= B$ #A,".J",A$ #A=#A-1 #A,0 #A *ERASE :RAM.0/EE.CLI 8 "*CLI .<"+B$