home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
programs
/
comms_networking
/
hearsay
/
!Hearsay
/
Libraries
/
General
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1996-07-04
|
3KB
|
151 lines
> General functions library
Chris Rutter, 1995
ct(address%)
string$
?address%>31
(string$)<255
string$+=
(?address%)
address%+=1
=string$
msg(token$)
ael("msg")
message_found%
debugmode%
verbose
debug_message("Request for message "+token$)
"XMessageTrans_Lookup",message_desc%,token$,message_buff%,256
,,,message_size%;message_found%
message_found%
$message_buff%=""
message_buff%?message_size%=13
ct(message_buff%)
msg_parse(msg_string$)
begin%,end%,message$,length%
msg_string$,"{")<
msg_string$,"}")
begin%=
msg_string$,"{")+1
end%=
msg_string$,"}")-1
length%=1+end%-begin%
* message$=
msg_string$,begin%,length%)
message$,"$")
message$=
(message$)
message$=
(message$))
E msg_string$=
msg_string$,begin%-2)+message$+
msg_string$,end%+2)
msg_string$,"<")<
msg_string$,">")
msg_string$,
msg_string$,">")-1,1)<>"-"
begin%=
msg_string$,"<")+1
end%=
msg_string$,">")-1
length%=1+end%-begin%
msg_string$,end%,1)<>"-"
$1 message$=
msg_string$,begin%,length%))
%F msg_string$=
msg_string$,begin%-2)+message$+
msg_string$,end%+2)
=msg_string$
error
$+" @ "+
)+" ["+error$+"]"
hexadecimal(value%)
=STR$(value%)
/!="0x"+
lower_case(
~(value%))
lower_case(string$)
(string$)=0
=string$
dummy%
dummy%=1
(string$)
string$,dummy%,1))>=
("A")
string$,dummy%,1))<=
("Z")
string$,dummy%)=
string$,dummy%,1))+32)
dummy%
=string$
char%
debugmode%
old_error$=error$
error$,".")=0
error$=""
char%=
(error$)
error$,char%,1)="."
error$=
error$,char%-1):char%=0:
debugmode%
old_char%=char%
char%
debugmode%
debug_message("] {MID$(old_error$,old_char%+1)}")
ael(string$)
debugmode%
debug_message("{string$} [")
(error$)+
(string$)+1<210
error$+="."+string$
notify(text$)
text$,1)="#"
text$=
text$,2))
text$=
msg_parse(text$)
debugmode%
debug_message(text$)
!error%=0
$(error%+4)=text$
"Wimp_ReportError",error%,1
(1<<4),"Warning from "+taskname_short$
blank_poll
action%
"Wimp_PollIdle",%11100011100101110011,wbk2%,20
action%
ct_text(block%,item%)
item%=0
ct(block%)
control%
?block%<32
control%+=1
block%+=1
control%=item%
ct(block%)
load_sprites
file$,size%
read_mode_variables
e!file$="<Hearsay$Dir>.Sprites"
xeig%<2
yeig%<2
file$+="22"
"OS_File",5,file$
,,,,size%
sprites% size%+4
"OS_File",255,file$,sprites%+4
!sprites%=size%+4
memory_needed%+=size%+4
read_mode_variables
debugmode%
debug_message("Reading mode variables...")
xs%,ys%
"OS_ReadModeVariable",-1,4
,,xeig%
"OS_ReadModeVariable",-1,5
,,yeig%
"OS_ReadModeVariable",-1,11
,,xs%
"OS_ReadModeVariable",-1,12
,,ys%