RISC OS BBC BASIC V Source | 1996-09-11 | 2.8 KB | 103 lines
> ProCopy Logfile tools
A_$="1.30, Sept 1996"
Temporary program only - full Wimp app with options eventually (!)
When run this will concatentate and sort any
ProCopy logfiles in it's Logs sub-directory.
263874:
'"Error "+
)+" : "+
$+" line "+
(B_%)+" in file":
*fx 229,27
-&8000:D_%=
E_%&2000,F_% 16:
12,12,"<ProCopyLog$Dir>",E_%,200,0,&2000,0
,,,H_%:
H_%=0
'"No Logfiles found!":
'"Procopy Logfile Tools - "+A_$:
'"Please select -":
" 1. Sort by disc name":
" 2. Sort by number of copies"':
:I_%=
I_%=27
(I_%>48
I_%<51):
"Program terminated":
"Sorting by disc name"'
"Sorting by number of copies"'
263872:J_%=E_%
- Load the file and expand lines to 20 chars with number of copies
K_%=1
H_%:T%=J_%!20:J_%+=24:N%=J_%:
?J_%>13:J_%+=1:
:?J_%=13:L_$="<ProCopyLog$Dir>."+$N%:
8,17,L_$
F%,,,,M_%:N_%=
O_(M_%*5+&2000)-256:P_%=N_%-&8000:
N_%<0
0,"Not enough RAM to process file "+$N%:
"Processing file "+$N%;:
8,16,L_$,D_%,0:Q_%=(D_%+M_%+7)
3:R_%=Q_%:S_%=D_%:T_%=S_%+M_%:B_%=0
S_%<T_%:
!S_%=&20202020
S_%>T_%-42 S_%=T_%
S_%+=40
:U_%=R_%:B_%+=1:
?S_%>31:?R_%=?S_%:S_%+=1:R_%+=1:
R_%<U_%+19:?R_%=32:R_%+=1:
:?R_%=10:R_%+=1:S_%+=1:
R_%>N_% N_%=
O_(P_%+&2000)-256:P_%=N_%+&8000:
N_%<0
0,"Not enough RAM to process file "+$N%
- Sort the list
<;V_%=(R_%-Q_%)
20:J%=Q_%:
79,V_%,D_%
(3<<30),4,0,Q_%,20
- concatentate the list
S_%=Q_%:R_%=Q_%:B_%=0:T_%=V_%*20+Q_%:W_%=
X_(S_%):Y_%=W_%:$T_%=" ":
S_%<T_%:S_%+=20:B_%+=1:
(!R_%=!S_%)
(R_%!4=S_%!4)
(R_%!8=S_%!8)
W_%+=
X_(S_%):Y_%+=W_%
:$(R_%+13)=
" "+
(W_%),6):R_%?19=10:R_%+=20:
4:R_%!J%=S_%!J%:
:W_%=
X_(R_%):Y_%+=W_%
no need to do any more
$R_%=" ------"+
(10)+"Total discs "+
" "+
(Y_%),7)+
10:R_%+=
($R_%):
8,10,L_$,&FFF,0,Q_%,R_%:J_%=(J_%+4)
" - Done":
263873:
'"Finished":
Z_:V_%=(R_%-Q_%)
79,V_%,D_%
(3<<30),a_%,0,Q_%,20:
X_(p%):p%+=18:
?p%=32:=1
?p%<>32:p%-=1:
33,10,p%
,,F%:=F%
O_(b_%):
262380,C_%+b_%,-1
e%<(C_%+b_%):=
:=e%+&8000
a_%&400:
2:P%=a_%:[OPT c_:.d_;enter with r0, r1 = pointers to objects:stmfd r13!,{r4,r5};store r4,r5:add r0,r0,#19;point to end of line:ldrb r4,[r0,#-1]!;get lsd in r4:ldrb r3,[r0,#-1]!:mov r3,r3,lsl#6
orr r4,r4,r3:ldrb r3,[r0,#-1]!:mov r3,r3,lsl#12:orr r4,r4,r3:ldrb r3,[r0,#-1]!:mov r3,r3,lsl#18:orr r4,r4,r3:ldrb r3,[r0,#-1]!:mov r3,r3,lsl#24:orr r4,r4,r3:add r1,r1,#19;point to end of line:ldrb r5,[r1,#-1]!;get lsd in r5