home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
programs
/
desktop
/
insert
/
!Insert
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1998-02-22
|
6KB
|
305 lines
> <Insert$Dir>.!RunImage
initiate
exit=
check(
$+", EXIT?")
poll%=%1110110110011
(calltype%=2
ts%>-1)
sending%
poll%=poll%
"Wimp_Poll",poll%,blk%
reason%
reason%
'
sending%
send
check
%
"Wimp_OpenWindow",,blk%
&
"Wimp_CloseWindow",,blk%
7
mouse(!blk%,blk%!4,blk%!8,blk%!12,blk%!16)
"
!blk%=2
closedown
/
17,18:
message(blk%!4,blk%!8,blk%!16)
closedown
initiate
mblen%=128:bs%=16*1024
blk% 1000, menubuffer% mblen%,text% bs%
$blk%="TASK"
program$="Insert"
dir$="<Insert$Dir>"
"Wimp_Initialise",200,!blk%,program$
,mytask%
6iconbar%=
createicon(-1,0,0,68,68,&2002,"!insert")
"Wimp_OpenTemplate",,dir$+".Templates"
#info%=
loadtemplate("info",256)
)options%=
loadtemplate("options",256)
"Wimp_CloseTemplate"
menuptr%=menubuffer%
!Amenubar%=
crmenu("Insert,Info>,info%,Options>,options%,Quit")
barheight%=items%*44+96
exit=
ts%=-1
sending%=
calltype%=0
closedown
"Wimp_CloseDown",mytask%
check
calltype%=2
"Wimp_GetPointerInfo",,blk%
blk%!12=-2
blk%!16=iconbar%
(-1)
sending%=
tp%=0
6
tp%<ts%
key%=text%?tp%
key%=10
key%=13
"Wimp_ProcessKey",key%
tp%+=1
sending%=
tp%=0
mouse(mx%,my%,but%,wind%,icon%)
wind%
but%
K.
2 :
menu(menubar%,mx%,barheight%)
sending%
sending%=
P.
calltype%=1
sending%=
:tp%=0
R
options% :
icon%>=0
calltype%=icon%:
"Wimp_CreateMenu",,-1
menu(data%,x%,y%)
openmenu%=data%
x%=x%-(data%!16)/2-16
"Wimp_CreateMenu",,data%,x%,y%
message(task%,ref%,message%)
message%
0 :
closedown
blk%!40<=&FFF
size%=blk%!36
size%<=bs%
trans%=0
tp%=0
ts%=-1
g" file$=
string(blk%+44)
blk%!20=text%
blk%!24=size%
reply(18,6)
l%
report("File too large")
n
(-1)
q file$=
string(blk%+44)
$text%=file$
ts%=
file$
tp%=0
u$
calltype%=0
sending%=
v
blk%!40<=&FFF
x file$=
string(blk%+44)
y)
"OS_File",5,file$
,,,,size%
size%<=bs%
ts%=-1
|+
"Wimp_GetPointerInfo",,blk%+8
blk%!28=blk%!8
blk%!32=blk%!12
blk%!36=-1
! !blk%=(48+
file$)
$(blk%+44)=file$+
reply(17,4)
'
"OS_File",255,file$,text%
ts%=size%
tp%=0
&
calltype%=0
sending%=
%
report("File too large")
trans%+=blk%!24
trans%=size%
ts%=size%
tp%=0
$
calltype%=0
sending%=
blk%!20+=blk%!24
blk%!24=size%-trans%
reply(18,6)
reply(type%,reason%)
blk%!12=ref%
blk%!16=reason%
"Wimp_SendMessage",type%,blk%,task%
loadtemplate(title$,indir%)
buff% indir%
"Wimp_LoadTemplate",,blk%,buff%,buff%+indir%,-1,title$
"Wimp_CreateWindow",,blk%
wind%
=wind%
crmenu(text$)
oldptr%=menuptr%
items%=0
text$+=","
title$=
nextword(text$)
$menuptr%=title$
max%=
title$
menuptr%!12=&70207
menuptr%!20=44
menuptr%!24=0
menuptr%+=4
text$<>""
items%+=1
menuptr%+=24
!menuptr%=0
menuptr%!4=0
word$=
nextword(text$)
token$=
token(word$)
token$<>""
token$
0
">" : menuptr%!4=
nextword(text$))
)
"/" : !menuptr%=!menuptr%
)
"-" : !menuptr%=!menuptr%
)
"!" : !menuptr%=!menuptr%
token$=
token(word$)
! menuptr%!8=(7<<24)
%10001
!menuptr%
token$="#"
$ menuptr%!8=menuptr%!8
1<<8
' menuptr%!12=
nextword(text$))
menuptr%!16=-1
menuptr%!20=
(word$)
A
menuptr%!20>max%
(!menuptr%
4)=0
max%=menuptr%!20
word$>12
& menuptr%!8=menuptr%!8
1<<8
menuptr%!12
word$
$(menuptr%!12)=word$
menuptr%!16=-1
menuptr%!20=
word$
$(menuptr%+12)=word$
%
word$>max%
max%=
word$
!menuptr%=!menuptr%
menuptr%+=24
oldptr%!16=max%*16+8
=oldptr%
token(
word$)
token$=""
">/!#-",
word$))
token$=
word$,1)
word$=
word$,
word$-1)
=token$
nextword(
text$)
word$,pos%
pos%=
text$,",")
word$=
text$,pos%-1)
text$=
text$,pos%+1)
=word$
createicon(!blk%,blk%!4,blk%!8,blk%!12,blk%!16,blk%!20,$(blk%+24))
"Wimp_CreateIcon",,blk%
icon%
=icon%
check(message$)
"Wimp_DragBox",,0
!blk%=0
$(blk%+4)=message$
"Wimp_ReportError",blk%,19,"Message from "+program$
,answer%
answer%=1
string(b%)
s$=""
?b%>31
s$+=
(?b%)
b%+=1
report(message$)
"Wimp_DragBox",,0
!blk%=0
$(blk%+4)=message$
"Wimp_ReportError",blk%,1,program$