home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1994-04-12 | 2.8 KB | 123 lines |
- >BuildActiv
- Builds the active file by scanning the newsbase for articles
- and deleting any ~seq files found.
- $+" (Code "+
- _assemble(64)
- dbsize%=256
- dirbuf% dbsize%,tmpblk% 512
- "active$=
- sysvar("News$Active")
- )newsbase$=
- sysvar("ReadNews$NewsDir")
- out%=
- active$
- scan("")
- #out%
- "OS_File",18,active$,&FFF
- scan(base$)
- file%,max%,file$,found%
- file%=0:max%=0:found%=
- , file$=
- read_dir(newsbase$+base$,file%)
- file$>""
- 8
- "OS_File",5,newsbase$+base$+"."+file$
- type%
- type%
-
- file$="~seq"
- 4
- "OS_File",6,newsbase$+base$+"."+file$
- file%-=1
-
- found%=
- #" max%=
- max(max%,
- file$)
-
- %$
- 2,3:
- scan(base$+"."+file$)
- &
- file%+=1
- file$=""
- file$=""
- file%=1 found%=
- found%
- ,) base$=
- groupname(
- lower(
- base$,2)))
- base$
- 40)max%
- #out%,base$+" "+
- "0000000"+
- (max%+1),8)+" 00000000 y"
- groupname(path$)
- pos%
- pos%=
- path$,"~.")
- pos%>0 path$=
- path$,pos%-1)+
- path$,pos%+2)
- pos%=0
- path$,5)="email"
- path$,1)="E"
- =path$
- lower(str$)
- A%,B%,C%
- $tmpblk%=str$
- >!A%=tmpblk%:B%=A%+256:C%=
- _tolowercase%
- max(a%,b%)
- a%>b%
- string0(a%)
- ?a%>31
- s$<255
- s$+=
- a%+=1
- read_dir(dir$,f%)
- files%,file$
- "OS_GBPB",9,dir$,dirbuf%,1,f%,dbsize%,"*"
- ,,,files%
- files%=0 file$=""
- file$=
- string0(dirbuf%)
- =file$
- sysvar(var$)
- len%,result$
- "XOS_ReadVarVal",var$,tmpblk%,255,0,3
- ,,len%
- len%>0
- tmpblk%?len%=13
- result$=$tmpblk%
- result$=""
- =result$
- _assemble(codelen%)
- code%,pass,notcaps
- code% codelen%
- pass=8
- P%=code%:L%=code%+codelen%
- [OPT pass
- ;tolowercase
- e3;Converts a string from multicase to lower case
- ;Entry- R0 -> Source string
- g$; R1 -> Destination buffer
- h!; R2 = length of string
- ._tolowercase%
- jD cmp r2,#0 ; Reached the end of the string?
- movle r3,#13
- lA strleb r3,[r1] ; if so, terminate the string
- m1 movle pc,r14 ; and exit.
- n4 ldrb r3,[r0],#1 ; r3 = character
- o8 cmp r3,#
- "A" ; is it less than "A"?
- pB blt notcaps ; if so then don't convert it.
- q; cmp r3,#
- "Z" ; is it greater than "Z"?
- rC addle r3,r3,#32 ; if not, convert to lower case
- .notcaps
- t9 strb r3,[r1],#1 ; store the character
- u7 sub r2,r2,#1 ; decrement counter
- v3 b _tolowercase% ; and loop back
-