home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
diskmanager
/
diskind_1
/
!DiskInd
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1995-09-10
|
28KB
|
1,075 lines
!RunImage
for !DiskInd
by JJF
September 1994
(c) JJF 1994
TRACE TO "<DiskInd$Dir>.Tracer"
TRACE ON
blk% &100,blk2% &100,dat% &100
killwimpext%=1
fraud%=
"<DiskInd$Dir>.Addr"
assemble("<DiskInd$Dir>.Code")
"<DiskInd$Dir>.Lib"
menu% &400,menu2% &400,menuind% &100
progwin% 500,progwinind% 350
blkforwindows% &1000,blkforwindowhandles% &100,ind% &B00
"Wimp_Initialise",200,&4B534154,"Disc Indexer"
,handle%
"WimpExt_Initialise",5,handle%,26
loop=0
8*4:blkforwindowhandles%!loop=0:
"WimpExt_LoadTemplates",blkforwindowhandles%,blkforwindows%,ind%,ind%+&17FF,-1,"<DiskInd$Dir>.Templates",1
"Wimp_OpenTemplate",,"<DiskInd$Dir>.Templates2"
"Wimp_LoadTemplate",,progwin%,progwinind%,progwinind%+349,-1,"Progress"
"Wimp_CloseTemplate"
"WimpExt_Heap",0,
"WimpExt_Heap",2,,16
,data%
"WimpExt_Heap",2,,16
,sd%
"WimpExt_Heap",2,,16
,dnlist%
"WimpExt_Heap",2,,16
,lineptrs%
"WimpExt_Heap",2,,16
,dnlineptrs%
"WimpExt_Heap",2,,1024*4
,linefndata%:ml%=1024
-&infohandle%=blkforwindowhandles%!8
.)seldrihandle%=blkforwindowhandles%!12
/'texthandle%=blkforwindowhandles%!16
0)dnlisthandle%=blkforwindowhandles%!20
1+infotexthandle%=blkforwindowhandles%!24
2)confighandle%=blkforwindowhandles%!28
3(searchhandle%=blkforwindowhandles%!4
4%renhandle%=blkforwindowhandles%!0
isregistered=
settext(infohandle%,0,"!DiskInd (Demo Version)")
8Lblk%!0=-2:blk%!4=0:blk%!8=0:blk%!12=68:blk%!16=68:blk%!20=(3<<12)+%11010
$(blk%+24)="!DiskInd"
"Wimp_CreateIcon",,blk%
iconbarh%
"WimpExt_SetIcon",,,searchhandle%,2,1
discs%=0
mem%=0
od%=discs%:om%=mem%
loadconfig
lines%=0
curmenu%=0
discstart%=-1
altered%=
textshowing%=0
"WimpExt_PrePoll"
"Wimp_Poll",0,blk%
reason%
"WimpExt_Action",handle%,blk%,reason%
reason%
reason%
redrawtext
"Wimp_OpenWindow",,blk%
"Wimp_CloseWindow",,blk%
click
select
17,18:
message
message
blk%!16
prequit2
1282:
click
mx%=blk%!0:my%=blk%!4
blk%!12
blk%!8
selact%
l!
discs%>0
opendnlist
openseldri
openconfig
iconbarmenu
adjact%
r!
discs%>0
opendnlist
openseldri
openconfig
seldrihandle%:
blk%!16
blk%!8=1
blk%!8=4 diskname2$="":
startscan
dnlisthandle%:
blk%!8=1
blk%!8=4
selfromdnlist
blk%!8=2
dnlistmenu
texthandle%:
blk%!8=1
discstart%<>-1
changetext
blk%!8=4
infotexthandle%:
(blk%!8=1
blk%!8=4)
blk%!16=3
setinfotext
confighandle%:
blk%!8=1
blk%!8=4
clickinconfig
searchhandle%:
blk%!16=4
"WimpExt_GetIcon",,,searchhandle%,2
check%:
check%=1
searchfnames(
readtext(searchhandle%,0))
"WimpExt_GetIcon",,,searchhandle%,3
check%:
check%=1
searchinfotext(
readtext(searchhandle%,0))
renhandle%:
blk%!16=2 diskname2$=
readtext(renhandle%,1):
diskname2$<>""
startscan
select
curmenu%
blk%!0
openseldri
blk%!4=0
showdisc(
ctrlstring(menuind%))
opendnlist
clear
openconfig
7:check%=
prequit:
check%=
blk%!0
blk%!4=0
rename(title$,
ctrlstring(menuind%))
remove(title$)
blk%!0
seldrihandle%:
blk%!24
13:diskname2$="":
startscan
"Wimp_ProcessKey",blk%!24
infotexthandle%:
blk%!24
setinfotext
"Wimp_ProcessKey",blk%!24
"Wimp_ProcessKey",blk%!24
iconbarmenu
curmenu%=1
setmenublock(menu%,"Disk Indexer",200)
addmenuitem(menu%+28,0,infohandle%,((7<<24)+%10001),"Info")
addmenuitem(menu%+52,0,-1,((7<<24)+%10001),"Scan Disk")
checkmenuitem2(menu%+76,0,menu2%,((7<<24)+%10001),&7000021-(
<<22),"Display Disc",discs%>0)
checkmenuitem2(menu%+100,0,searchhandle%,((7<<24)+%10001),&7000021-(
<<22),"Search",discs%>0)
checkmenuitem2(menu%+124,0,-1,((7<<24)+%10001),&7000021-(
<<22),"Clear",discs%>0)
checkmenuitem2(menu%+148,0,-1,((7<<24)+%10001),&7000021-(
<<22),"Save",discs%>0)
addmenuitem(menu%+172,0,-1,((7<<24)+%10001),"Config")
addmenuitem(menu%+196,128,-1,((7<<24)+%10001),"Quit")
setmenublock(menu2%,"Disc Name",200)
addindirectmenuitem(menu2%+28,132,-1,&7000119,"",menuind%,20)
"WimpExt_CreateMenu",,menu%,mx%-64,96+(40*8)
openseldri
blk%!0=seldrihandle%
"Wimp_GetWindowState",,blk%
blk%!28=-1
"Wimp_OpenWindow",,blk%
selfromdnlist
y%,discsel%
7blk%!0=dnlisthandle%:
"Wimp_GetWindowState",,blk%
y%=((blk%!16)-my%)-(blk%!24)
discsel%=y%
discsel%>discs%-1
discsel%<0
showdisc($((!((!dnlineptrs%)+(discsel%*4)))+(!dnlist%)))
changetext
y%,fnsel%,temp$
5blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%
y%=((blk%!16)-my%)-(blk%!24)
fnsel%=(y%
fnsel%>lines%
fnsel%<0
&mem2%=!((!linefndata%)+(fnsel%*4))
mem2%<0
:fnsel%-=1:mem2%=!((!linefndata%)+(fnsel%*4)):
mem2%>-1
mem2%=0
5temp$=
ctrlstring(mem2%+!data%):mem2%+=
(temp$)+1
mem2%+=9
4putit%=mem2%:infotext$=
ctrlstring(mem2%+!data%)
settext(infotexthandle%,0,infotext$)
settext(infotexthandle%,2,temp$)
"Wimp_CreateMenu",,infotexthandle%,mx%-64,my%
"WimpExt_PutCaretIcon",,,infotexthandle%,0
setinfotext
memneeded%
od%=discs%:om%=mem%
altered%=
*infotext$=
readtext(infotexthandle%,0)
memneeded%=
(infotext$)+1
#mem2%=
trackctrl(putit%+!data%)
copymem(mem2%,putit%+!data%,mem%+!data%):mem%-=(mem2%-!data%)-putit%
"WimpExt_Heap",4,data%,mem%+memneeded%
,check%:
check%=0
nomem
copymem(putit%+!data%,putit%+memneeded%+!data%,mem%+!data%):mem%+=memneeded%
$(putit%+!data%)=infotext$
rereaddisc(discstart%+!data%)
od%=discs%:om%=mem%
"Wimp_CreateMenu",,-1
showdisc(diskname$)
mem2%,searched%,curdisc%
"Hourglass_On"
mem2%=!data%
curdisc%=0
diskname$=
caps(diskname$)
curdisc%+=1
!dn$=
caps(
ctrlstring(mem2%))
dn$<>diskname$
mem2%+=
(dn$)+1
mem2%=
trackctrl(mem2%)
mem2%=
findendofdir(mem2%)
dn$=diskname$
curdisc%=discs%
"Hourglass_Off"
dn$<>diskname$
whinge("Unknown disc name!"):
"Hourglass_On"
memused%=0
discstart%=mem2%-(!data%)
mem2%=
trackctrl(mem2%)
ctrlstring(mem2%)
?memused%=
addstringtoheap(cn$,sd%,memused%):mem2%+=
(cn$)+1
lines%=1
listdir(0)
"WimpExt_Heap",4,lineptrs%,lines%*4
,check%:
check%=0
nomem
!mem_sd=sd%
!mem_lineptrs=lineptrs%
!lines=lines%
makelinesdata
closeifopen(texthandle%)
Bblk%!0=0:blk%!4=-(lines%*36)-8:blk%!8=(maxlen*16)+38:blk%!12=0
"WimpExt_SetExtent",texthandle%,blk%
"WimpExt_OpenFullSize",,,texthandle%,-1
5blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%
2blk%!20=0:blk%!24=0:
"Wimp_OpenWindow",,blk%
"Hourglass_Off"
rereaddisc(mem2%)
"Hourglass_On"
memused%=0
discstart%=mem2%-(!data%)
mem2%=
trackctrl(mem2%)
ctrlstring(mem2%)
?memused%=
addstringtoheap(cn$,sd%,memused%):mem2%+=
(cn$)+1
lines%=1:data2%=!data%
listdir(0)
"WimpExt_Heap",4,lineptrs%,lines%*4
,check%:
check%=0
nomem
!mem_sd=sd%
!mem_lineptrs=lineptrs%
!lines=lines%
makelinesdata
Bblk%!0=0:blk%!4=-(lines%*36)-8:blk%!8=(maxlen*16)+38:blk%!12=0
"WimpExt_SetExtent",texthandle%,blk%
"WimpExt_CheckWindowOpen",texthandle%
check%:
check%=1 blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%:
"Wimp_CloseWindow",,blk%:blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%:
"Wimp_OpenWindow",,blk%
"Hourglass_Off"
findendofdir(mem%)
!findendofdir_mem=mem%
findendofdir
=!findendofdir_mem
listdir(level%)
textshowing%=1
!mem2=mem2%
!lines=lines%
!pos=memused%
!mem_linefndata=linefndata%
!mem_sd=sd%
!mem_data=data%
!level=level%*2
2!!canimagebeapp=canimagebeapp%
!showinapp=showinapp%
!mem_maxlen=75
listdir_start
maxlen=!mem_maxlen
mem2%=!mem2
lines%=!lines
9#check%=!error:
check%=0
nomem
redrawtext
loop=1
more%,x0%,x1%,y0%,y1%,I%,T%,B%,S%
winredrawing%=blk%!0
@ S%=36
"Wimp_RedrawWindow",,blk%
more%
more%
redrawtext_decodeblock
T%=(-(gtop%-w_sy%)-S%)/S%
T%<0 T%=0
B%=(-(gbot%-w_sy%))/S%
winredrawing%=texthandle%
B%>=lines% B%=lines%-1
winredrawing%=dnlisthandle%
B%>=discs% B%=discs%-1
I%=T%
x0%=8+w_sx%
y1%=-8-S%*I%+w_sy%
x0%,y1%
winredrawing%=texthandle%
!((!linefndata%)+(I%*4))<0
-!((!linefndata%)+(I%*4))
winredrawing%=texthandle%
$(!((!lineptrs%)+(I%*4))+!sd%)
winredrawing%=dnlisthandle%
$(!((!dnlineptrs%)+(I%*4))+!dnlist%)
"Wimp_GetRectangle",,blk%
more%
redrawtext_decodeblock
w_sx%=blk%!4-blk%!20
w_sy%=blk%!16-blk%!24
gtop%=blk%!40
gbot%=blk%!32
updatednlist
discs%=0
mem2%=!data%
memused%=0
"WimpExt_Heap",4,dnlineptrs%,discs%*4
,check%:
check%=0
nomem
maxlen%=10
loop=0
discs%-1
d'!((!dnlineptrs%)+(loop*4))=memused%
e>dn$=$mem2%:mem2%+=
(dn$)+1:
(dn$)>maxlen% maxlen%=
(dn$)
f3memused%=
addstringtoheap(dn$,dnlist%,memused%)
mem2%=
trackctrl(mem2%)
mem2%=
findendofdir(mem2%)
jCblk%!0=0:blk%!4=-(discs%*36)-8:blk%!8=(maxlen%*16)+16:blk%!12=0
"WimpExt_SetExtent",dnlisthandle%,blk%
"WimpExt_CheckWindowOpen",dnlisthandle%
check%:
check%=1
m7blk%!0=dnlisthandle%:
"Wimp_GetWindowState",,blk%
n+ob%=blk%!28:
"Wimp_CloseWindow",,blk%
"WimpExt_OpenFullSize",,,dnlisthandle%,ob%
opendnlist
"WimpExt_OpenFullSize",,,dnlisthandle%,-1
openconfig
updateconfig
y6!blk%=confighandle%:
"Wimp_GetWindowState",,blk%
"Wimp_OpenWindow",,blk%
updateconfig
loop=9
"WimpExt_SetIcon",,,confighandle%,loop,0:
"WimpExt_SetIcon",,,confighandle%,15+scaninapp%,1
"WimpExt_SetIcon",,,confighandle%,16-scaninapp%,0
"WimpExt_SetIcon",,,confighandle%,9+showinapp%,1
"WimpExt_SetIcon",,,confighandle%,
"212528",(selact%*2)+1,2)),1
"WimpExt_SetIcon",,,confighandle%,
"222629",(adjact%*2)+1,2)),1
"WimpExt_SetIcon",,,confighandle%,30,autodispcat%
"WimpExt_SetIcon",,,confighandle%,31,killwimpext%
"WimpExt_SetIcon",,,confighandle%,32,autosave%
"WimpExt_SetIcon",,,confighandle%,34,canimagebeapp%
clickinconfig
blk%!16
setconfig
6:!blk%=confighandle%:
"Wimp_GetWindowState",,blk%:
"Wimp_CloseWindow",,blk%
setconfig:
saveconfig
setconfig
loop,var1%,var2%,var3%,var4%
var1%=-1
loop=15
"WimpExt_GetIcon",,,confighandle%,loop
check%
check%=1 var1%=loop-15
var1%=-1
whinge("Please select whether or not to scan inside applications."):
var2%=-1
loop=9
"WimpExt_GetIcon",,,confighandle%,loop
check%
check%=1 var2%=loop-9
var2%=-1
whinge("Please select an option from the 'Show inside apps' box"):
var3%=-1
loop=0
"WimpExt_GetIcon",,,confighandle%,
"212528",(loop*2)+1,2))
check%
check%=1 var3%=loop
var3%=-1
whinge("Please select an action to be performed when SELECT is used on the icon bar icon."):
var4%=-1
loop=0
"WimpExt_GetIcon",,,confighandle%,
"222629",(loop*2)+1,2))
check%
check%=1 var4%=loop
var4%=-1
whinge("Please select an action for ADJUST to perform on the icon bar icon."):
scaninapp%=var1%
showinapp%=var2%
selact%=var3%
adjact%=var4%
"WimpExt_GetIcon",,,confighandle%,30
autodispcat%
"WimpExt_GetIcon",,,confighandle%,31
killwimpext%
"WimpExt_GetIcon",,,confighandle%,32
autosave%
"WimpExt_GetIcon",,,confighandle%,34
canimagebeapp%
6!blk%=confighandle%:
"Wimp_GetWindowState",,blk%
"Wimp_CloseWindow",,blk%
saveconfig
"<DiskInd$Dir>.Config"
#fh%,scaninapp%
#fh%,showinapp%
#fh%,selact%
#fh%,adjact%
#fh%,autodispcat%
#fh%,killwimpext%
#fh%,autosave%
#fh%,canimagebeapp%
loadconfig
"<DiskInd$Dir>.Config"
#fh%,scaninapp%
#fh%,showinapp%
#fh%,selact%
#fh%,adjact%
#fh%,autodispcat%
#fh%,killwimpext%
#fh%,autosave%
#fh%,canimagebeapp%
dnlistmenu
curmenu%=2
7blk%!0=dnlisthandle%:
"Wimp_GetWindowState",,blk%
y%=((blk%!16)-my%)-(blk%!24)
discsel%=y%
discsel%>discs%-1
discsel%<0
(mem2%=!((!linefndata%)+(discsel%*4))
9title$=$((!((!dnlineptrs%)+(discsel%*4)))+(!dnlist%))
setmenublock(menu%,"'"+title$+"'",120)
addmenuitem(menu%+28,0,menu2%,((7<<24)+%10001),"Rename")
addmenuitem(menu%+52,128,-1,((7<<24)+%10001),"Remove")
setmenublock(menu2%,"Rename",190)
addindirectmenuitem(menu2%+28,132,-1,&7000119,title$,menuind%,20)
"WimpExt_CreateMenu",,menu%,mx%-64,my%
rename(title$,newname$)
altered%=
newname$=""
newname$=title$
\check%=
exists(newname$):
check%=
whinge("There is already a disc with that name!"):
"WimpExt_Heap",4,!data%,mem%+20
,check%:
check%=0
nomem
"Hourglass_On"
mem2%=!data%
title$=
caps(title$)
!dn$=
caps(
ctrlstring(mem2%))
dn$<>title$
mem2%+=
(dn$)+1
mem2%=
trackctrl(mem2%)
mem2%=
findendofdir(mem2%)
dn$=title$
tit$=
ctrlstring(mem2%)
copymem(mem2%+
(tit$)+1,mem2%,mem%+!data%)
mem%-=
(tit$)+1
copymem(mem2%,mem2%+
(newname$)+1,mem%+!data%)
mem%+=
(newname$)+1
$mem2%=newname$
"WimpExt_Heap",4,!data%,mem%
"Wimp_CreateMenu",,-1
updatednlist
closeifopen(texthandle%)
"Hourglass_Off"
od%=discs%:om%=mem%
remove(name$)
altered%=
"Hourglass_On"
mem2%=!data%
name$=
caps(name$)
!dn$=
caps(
ctrlstring(mem2%))
dn$<>name$
mem2%+=
(dn$)+1
mem2%=
trackctrl(mem2%)
mem2%=
findendofdir(mem2%)
dn$=name$
mem3%=mem2%+
(dn$)+1
mem3%=
trackctrl(mem3%)
mem3%=
findendofdir(mem3%)
mem3%<>mem%+!data%
copymem(mem3%,mem2%,mem%+!data%)
mem%-=mem3%-mem2%
discs%-=1
mem%=0
"WimpExt_Heap",4,data%,16
"WimpExt_Heap",4,data%,mem%
"Wimp_CreateMenu",,-1
discs%>0
updatednlist
closeifopen(dnlisthandle%)
closeifopen(texthandle%)
"Hourglass_Off"
od%=discs%:om%=mem%
exists(name$)
Checks if a disc of name name$ already exists
dn$,mem2%,curdisc%,check%
discs%=0
name$=
caps(name$)
check%=
curdisc%=0
mem2%=!data%
$!dn$=
caps(
ctrlstring(mem2%))
dn$=name$ check%=
mem2%+=
(dn$)+1
mem2%=
trackctrl(mem2%)
mem2%=
findendofdir(mem2%)
curdisc%+=1
check%
curdisc%=discs%
=check%
searchfnames(sf$)
sf$=""
ol%=lines%
caps(sf$)
"Hourglass_On"
$searchstr=sf$
!mem2=!data%
!discs=discs%
!mem_data=data%
!mem_sd=sd%
!mem_linefndata=linefndata%
!mem_maxlen=75
searchfilenames
maxlen=!mem_maxlen
;#check%=!error:
check%=0
nomem
lines%=!lines
"Hourglass_Off"
"Wimp_CreateMenu",,-1
lines%=0 lines%=ol%:
mess("Not found!"):
"WimpExt_Heap",4,lineptrs%,lines%*4
,check%:
check%=0
nomem
!mem_sd=sd%
!mem_lineptrs=lineptrs%
!lines=lines%
makelinesdata
closeifopen(texthandle%)
FBblk%!0=0:blk%!4=-(lines%*36)-8:blk%!8=(maxlen*16)+38:blk%!12=0
"WimpExt_SetExtent",texthandle%,blk%
"WimpExt_OpenFullSize",,,texthandle%,-1
I5blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%
J2blk%!20=0:blk%!24=0:
"Wimp_OpenWindow",,blk%
textshowing%=2
searchinfotext(sf$)
sf$=""
ol%=lines%
caps(sf$)
"Hourglass_On"
$searchstr=sf$
!mem2=!data%
!discs=discs%
!mem_data=data%
!mem_sd=sd%
!mem_linefndata=linefndata%
!mem_maxlen=75
searchinfotext
maxlen=!mem_maxlen
\#check%=!error:
check%=0
nomem
lines%=!lines
"Hourglass_Off"
"Wimp_CreateMenu",,-1
lines%=0 lines%=ol%:
mess("Not found!"):
"WimpExt_Heap",4,lineptrs%,lines%*4
,check%:
check%=0
nomem
!mem_sd=sd%
!mem_lineptrs=lineptrs%
!lines=lines%
makelinesdata
closeifopen(texthandle%)
gBblk%!0=0:blk%!4=-(lines%*36)-8:blk%!8=(maxlen*16)+38:blk%!12=0
"WimpExt_SetExtent",texthandle%,blk%
"WimpExt_OpenFullSize",,,texthandle%,-1
j5blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%
k2blk%!20=0:blk%!24=0:
"Wimp_OpenWindow",,blk%
textshowing%=2
"Hourglass_On"
y%,linesel%,fn$,mem2%,fn2$,count%
r5blk%!0=texthandle%:
"Wimp_GetWindowState",,blk%
s y%=((blk%!16)-my%)-(blk%!24)
linesel%=y%
linesel%<0
linesel%>lines%-1
"Hourglass_Off":
v(mem2%=!((!linefndata%)+(linesel%*4))
mem2%<0
:linesel%-=1:mem2%=!((!linefndata%)+(linesel%*4)):
mem2%>-1
textshowing%
1:fn$=
findpath(linesel%)
2:fn$=$(!((!lineptrs%)+(linesel%*4))+!sd%)
{; count%=1:
:fn2$=
fn$,count%):count%+=1:
fn2$,1)=" "
fn$=
fn2$,
(fn2$)-1)
"Hourglass_Off"
"XOS_CLI","Filer_Run "+fn$
findpath(linesel%)
level%,path$,loop,level2%
:level%=
countspaces(!((!lineptrs%)+(linesel%*4))+!sd%)
7path$=
firstword(!((!lineptrs%)+(linesel%*4))+!sd%)
linesel%=0
=path$
loop=linesel%-1
7level2%=
countspaces(!((!lineptrs%)+(loop*4))+!sd%)
level2%<level%
!((!linefndata%)+(loop*4))>-1 level%=level2%:path$=
firstword(!((!lineptrs%)+(loop*4))+!sd%)+"."+path$
=path$
countspaces(mem2%)
!mem2=mem2%
countspaces
=!mem2
firstword(mem2%)
!mem2=mem2%
firstword
=$ctrlstring_str
FNreadtext, PROCdrag, PROCdraggedbox, FNleafname by A J Cawte.
readtext(wi%,ic%)
!dat%=wi%
dat%!4=ic%
"Wimp_GetIconState",,dat%
ctrlstring(dat%!28)
ctrlstring(ad%)
!ctrlstring_mem=ad%
ctrlstring
=$ctrlstring_str
settext(wd%,ic%,t$)
sets the icon, handle 'ic%' in window 'wd%' to string t$
"WimpExt_SetIconString",,,wd%,ic%,t$
"OS_ReadModeVariable",-1,11
,,xl%
"OS_ReadModeVariable",-1,4
,,xe%:xl%=xl%*2^xe%
"OS_ReadModeVariable",-1,12
,,yl%
"OS_ReadModeVariable",-1,5
,,ye%:yl%=yl%*2^ye%
.!blk%=saveh%:
"Wimp_GetWindowState",,blk%
5!dat%=saveh%:dat%!4=0:
"Wimp_GetIconState",,dat%
blk%!20=blk%!8+dat%!20+160
blk%!16=blk%!4+dat%!16
blk%!12=blk%!8+dat%!12+160
blk%!8=blk%!4+dat%!8
blk%!4=5
/blk%!24=0:blk%!28=0:blk%!32=xl%:blk%!36=yl%
"Wimp_DragBox",,blk%
draggedbox
save$=
readtext(saveh%,1)
"Wimp_GetPointerInfo",,dat%
!!blk%=256:blk%!12=0:blk%!16=1
@blk%!20=dat%!12:blk%!24=dat%!16:blk%!28=!dat%:blk%!36=dat%!4
blk%!36=100
blk%!40=&453
$(blk%+44)=
leafname(save$)
"Wimp_SendMessage",17,blk%,blk%!20
leafname(file$)
file$,".")<>0
'file$=
file$,(
file$)-
file$,"."))
=file$
setmenublock(block%,text$,width%)
$block%=text$
3block%?12=7:block%?13=2:block%?14=7:block%?15=0
block%!16=width%
block%!20=40
block%!24=0
addmenuitem(addr,flags,pointer,iconflags,entry$)
A!addr=flags:addr!4=pointer:addr!8=iconflags:$(addr+12)=entry$
checkmenuitem1(addr,flags1,flags2,pointer,iconflags,entry$,test%)
test%=
addmenuitem(addr,flags1,pointer,iconflags,entry$)
test%=
addmenuitem(addr,flags2,pointer,iconflags,entry$)
checkmenuitem2(addr,flags,pointer,iconflags1,iconflags2,entry$,test%)
test%=
addmenuitem(addr,flags,pointer,iconflags1,entry$)
test%=
addmenuitem(addr,flags,pointer,iconflags2,entry$)
addindirectmenuitem(addr,flags,pointer,iconflags,entry$,addr2,len)
addmenuitem(addr,flags,pointer,iconflags,"")
addr!12=addr2
addr!16=-1
addr!20=len+1
$addr2=entry$
caps(txt$)
pos%
(txt$)<1 txt$=" "
txt2$=""
pos%=1
(txt$)
txt$,pos%,1))>96
txt$,pos%,1))<123
txt2$+=
txt$,pos%,1))-32)
txt2$+=
txt$,pos%,1)
=txt2$
copymem(from%,to%,end%)
from%=to%
from%
4=0
to%
4=0
"WimpExt_MemCopy",from%,to%,end%-from%:
!from=from%
!to=to%
!end=end%
to%<from%
copymem
copymembackwards
fraud%=
fraud%=
whinge(
$+" at line "+
prequit2
whinge(txt$)
"Hourglass_Smash"
!blk%=0
$(blk%+4)=txt$
"Wimp_ReportError",blk%,2,"Disk Indexer"
"WimpExt_CloseDown",handle%
"Wimp_CloseDown",handle%,&4B534154
killwimpext%=1
"RmKill WimpExtension"
getcarname(disk$)
"OS_FSControl",37,disk$,blk2%,0,0,256
ctrlstring(blk2%)
getdiskname(disk$)
cn$,pos%,diskname$
getcarname(disk$)
pos%=1
cn$,pos%,1)=
disk$,pos%,1)
pos%<(
(cn$)+1)
pos%+=1
diskname$=""
cn$,pos%,1)<>"."
pos%<(
(cn$)+1)
diskname$+=
cn$,pos%,1)
pos%+=1
diskname$=""
mess("I am unable to read this disc's name."):
renamedisk
=diskname$
trackctrl(mem%)
!trackctrl_mem=mem%
trackctrl
=!trackctrl_mem
addstringtoheap(string$,anchor%,pos%)
len%
len%=
(string$)
"WimpExt_Heap",4,anchor%,pos%+len%+1
,check%:
check%=0
nomem
$(pos%+!anchor%)=string$
pos%+=len%+1
4 =pos%
prequit
altered%=
autosave%=1
save:=
mem2%,choice%
mem2%=blk%
$mem2%="Save":mem2%+=5
$mem2%="Discard":mem2%+=8
$mem2%="Cancel":mem2%+=7
$mem2%=
(13)+
"WimpExt_ControlImmediate",,2,"Warning from !DiskInd","Data has been modified since last save.",blk%,2
choice%
choice%=0
save:=
choice%=1 =
choice%=2 =
prequit2
altered%=
autosave%=1
save:
mem2%,choice%
mem2%=blk%
$mem2%="Save":mem2%+=5
$mem2%="Discard":mem2%+=8
$mem2%=
(13)+
(13)+
"WimpExt_ControlImmediate",,2,"Warning from !DiskInd","Data has been modified since last save.",blk%,1
choice%
choice%=0
nomem
mem2%
mem2%=blk%
$mem2%="Continue":mem2%+=9
T"$mem2%=
(13)+
(13)+
(13)+
"WimpExt_ControlImmediate",,2,"Error from !DiskInd","I am unable to claim enough memory. Please free more memory and try again.",blk%,0
discs%=od%:mem%=om%
updatednlist
closeifopen(texthandle%)
closeifopen(infotexthandle%)
fraud%=
Goggles
closeifopen(windowhandle%)
check%
"WimpExt_CheckWindowOpen",windowhandle%
check%
check%=0
a6!blk%=windowhandle%:
"Wimp_GetWindowState",,blk%
"Wimp_CloseWindow",,blk%
mess(mess$)
mem2%
mem2%=dat%
$mem2%="OK":mem2%+=3
i"$mem2%=
(13)+
(13)+
(13)+
"WimpExt_ControlImmediate",,2,"Message from !DiskInd",mess$,dat%,0
diskexists
mem2%=dat%
$mem2%="Rename":mem2%+=7
$mem2%="Update":mem2%+=7
$mem2%="Cancel":mem2%+=7
$mem2%=
(13)+
"WimpExt_ControlImmediate",,2,"Message from !DiskInd","A disk of this name is already known by !DiskInd.",dat%,2
choice%
"WimpExt_ControlImmediate",,0
choice%=2 cancel%=
cancel%=
choice%=1
remove(diskname$):
renamedisk
renamedisk
cancel%=
"Wimp_CreateMenu",,renhandle%,mx%-64,my%
clear
mem2%=dat%
$mem2%="OK":mem2%+=3
$mem2%="Cancel":mem2%+=7
$mem2%=
(13)+
(13)+
"WimpExt_ControlImmediate",,2,"Message from !DiskInd","This will erase all of the discs from memory. Please confirm.",dat%,1
choice%
choice%=1
discs%=0
mem%=0
"WimpExt_Heap",4,data%,16
"WimpExt_Heap",4,sd%,16
"WimpExt_Heap",4,dnlist%,16
"WimpExt_Heap",4,lineptrs%,16
"WimpExt_Heap",4,dnlineptrs%,16
closeifopen(texthandle%)
closeifopen(dnlisthandle%)
altered%=
"OS_Find",&8F,"<DiskInd$Dir>.Data"
dat%!0=discs%
dat%!4=mem%
"OS_GBPB",2,fh%,dat%,8
"OS_GBPB",2,fh%,!data%,mem%
"OS_Find",0,fh%
pointer%,fh%
"OS_Find",&4F,"<DiskInd$Dir>.Data"
"OS_GBPB",3,fh%,dat%,8,0
,,,,pointer%
discs%=dat%!0
mem%=dat%!4
mem%>16
"WimpExt_Heap",4,data%,mem%
check%:
check%=0
nomem
mem%<17
"WimpExt_Heap",4,data%,16
"OS_GBPB",3,fh%,!data%,mem%,pointer%
,,,,pointer%
"OS_Find",0,fh%
discs%>0
updatednlist:
opendnlist
blk%!12=blk%!8
blk%!16=&503
text$=""
blk%!32
-2:text$="This is the !DiskInd icon. Click MENU to bring up the icon bar menu."
infohandle%:text$="This window displays information about !DiskInd."
seldrihandle%:
blk%!36
2:text$="This box contains the path to scan."
3:text$="Click here to index the disc."
texthandle%:
textshowing%
1:text$="This is the text window. Click SELECT to run an item, or ADJUST to change it's info text."
2:text$="This is the text window. Click SELECT to run an item."
dnlisthandle%:text$="This window lists all of the discs that the computer knows about. Click SELECT to display one, or MENU to access a menu."
infotexthandle%:text$="This window allows you to edit an item's info text."
confighandle%:
blk%!36
15,16:text$="Click here to tell the computer whether or not to scan inside applications."
9,10,11,12,13:text$="Click on one of these icons to select when you wish to see what is inside an application."
21,25,28:text$="These icons allow you to select what happens when you click SELECT on the icon bar icon."
22,26,29:text$="These icons allow you to select what happens when you click ADJUST on the icon bar icon."
31,32,33,34:text$="These icons allow you to fine-tune the operation of !DiskInd to your own personal taste."
5:text$="Click here to confirm the new configuration."
6:text$="Click here to return to the old configuration."
7:text$="Click here to save this configuration."
L text$="This window allows you to alter the configuration of !DiskInd."
searchhandle%:
blk%!36
0:text$="Type what you wish to search for into this box."
2:text$="Click on this icon if you wish to search for a particular filename."
3:text$="Click on this icon if you wish to search for a particular phrase in the info text."
4:text$="Click here to commence the search."
renhandle%:text$="Type in here what you want to call the disc."
$(blk%+20)=text$
%blk%!0=(((20+
(text$)+1)
4)*4)+4
$(blk%+21+
(text$))=
"Wimp_SendMessage",17,blk%