home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
programs
/
programming
/
msgutils
/
MsgEncode
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1997-12-26
|
2KB
|
75 lines
__ _
|_) /| Copyright Richard Atterer
| \/
| written on 23-07-1997 - Freeware
ArcWeb Message file: Replace text with references to dictionary entries
in all 'dict' tags and tags following them
NB 'dict' tags in get$ must not contain references to other dict. entries
get$="RAM:MsgExpand"
put$="RAM:Messages"
dic$="dict"
$+" ("+
+")":
maxfile%=9999:maxdic%=199
m$(maxfile%),dic$(maxdic%),dicline%(maxdic%),dicorder%(maxdic%)
get$:lines%=0:dic%=0:firstdicline%=0
a$=
#g%:m$(lines%)=a$
dic$)=dic$ n%=
dic$+1)):dic$(n%)=
a$,":")+1):dicline%(n%)=lines%:lastdicline%=lines%:
firstdicline%=0 firstdicline%=lines%
lines%+=1
dicentries%=0
maxdic%:dicorder%(i%)=i%:
dic$(i%)<>"" dicentries%=i%
dicentries%-2
j%=i%+1
dicentries%-1:
dic$(dicorder%(i%))<
dic$(dicorder%(j%))
dicorder%(i%),dicorder%(j%)
$p%=
put$:
"SetType "+put$+" FFF"
firstdicline%-1
#p%,m$(i%)
$ a$=""
i%=firstdicline%
lastdicline%
n%=
m$(i%),
dic$+1))
a$,dic$(n%):
#p%,dic$+
n%+":"+
encode(a$):
a$,dic$(n%)
i%=lastdicline%+1
lines%-1
n%=
m$(i%),":")
m$(i%),1)<>"#"
,[
m$(i%)-n%>235
"Warning: Value of '"
m$(i%),n%-1)"' is ";
m$(i%)-n%" chars long"
-/
m$(i%),n%)+
encode(
m$(i%),n%+1))
.
#p%,m$(i%)
encode(a$)
i%,n%
dicentries%-1
:; j%=dicorder%(i%):
dic$(j%)<>"" n%=
a$,dic$(j%))
n% a$=
a$,n%-1)+"%"+
a$,n%+
dic$(j%)):n%=-
a$,dic$(j%),n%)*(dic$(j%)<>""):