Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features » DiskTree+/!DiskTree/!RunImage
DiskTree+/!DiskTree/!RunImage
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199604.adf » Features |
Filename: | DiskTree+/!DiskTree/!RunImage |
Read OK: | ✔ |
File size: | A0C6 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10ON ERROR PROCmess(REPORT$+" : at line "+STR$ERL):END 20REM *>$.!DiskTree.!RunImage 30REM *Main Program for !DiskTree - Directory Tree Creator 40REM *Version 1.08 (1 Feb '96) 50REM *Authur LEN J. Robbins 60maxno=150 70DIM block &1000, menu% 2048, curbuf% 7*1024, icond 2048, mblock 256 80DIM longdata (maxno*13)+24, longmen (maxno*24)+48 90DIM tree(maxno),lastdir(256),buffer 63,tblk 1024 100DIM tsize(maxno),tcount(maxno),tlen(maxno),troot$(maxno),arc$(maxno) 110endbuf%=curbuf%+&6000 120end%=-1:toolson=TRUE:quiting=FALSE:totallen=0:found=FALSE:upto=-1:uptot=-1:oldst=-1 130saved=FALSE:prequitwait=FALSE:prequit=FALSE:sel=-1:tt=tblk:arclisted=FALSE 140in=FALSE:started=0:ct=-1:arcct=-1:width=-1:itemno=-1:rc=-1:s1=-1:s2=-1:ss=-1 150task=&4B534154 160SYS "Wimp_Initialise",200,task,"!DiskTree" TO version%,mytask% 170SYS "Wimp_ClaimInterface",mytask% 180reinter=&81683 190PROCtemplate 200SYS"XOS_ReadVarVal","DTree$Drag",block,256,0,0 TO ,,len:block?len=13:drag$=$block 210IF drag$="TRUE" THEN dragspr=TRUE ELSE dragspr=FALSE 220env$="" 230SYS "OS_GetEnv" TO env$ 240IF INSTR(env$,"-quit") THEN 250I%=INSTR(env$,"""") 260I%=INSTR(env$,"""",I%+1) 270REPEAT 280I%+=1 290UNTIL MID$(env$,I%,1)<>" " 300env$=MID$(env$,I%) 310ENDIF 320initic=FNicon 330SYS"Wimp_SlotSize",-1,-1 TO orig 340max=HIMEM-END:max=INT(max/1024)*1024 350max-=&4000 360end%=FALSE:drag%=0:drive%=0 370SYS"Wimp_SlotSize",-1,-1 TO current 380HIMEM=HIMEM-max:hsizeb=max:heap%=HIMEM 390IF hsizeb<1024 THEN END 400SYS"OS_Heap",0,heap%,,hsizeb 410origheap=hsizeb:origappsize=current 420ON ERROR PROCerror(REPORT$+" : at line "+STR$ERL) 430PROCinfo(bar%,0,"None") 440PROCadjustwin(500,-500) 450PROCseticstate(save%,4,1<<22,1<<22) 460PROCseticstate(find%,4,1<<22,1<<22) 470IF env$<>"" PROCload(env$) 480REPEAT 490SYS"Wimp_Poll",0,block TO eventcode 500SYS "Wimp_PollPointer",eventcode,,version% 510CASE eventcode OF 520WHEN 0:IF NOT saved AND prequit SYS"Wimp_ProcessKey",&1FC 530WHEN 1:PROCredraw(block!0) 540WHEN 2:PROCrequest2 550WHEN 3:PROCrequest3 560WHEN 6:PROCclick(block) 570WHEN 7:PROCout 580WHEN 8:PROCprocess 590WHEN 9:PROCselect 600WHEN 10:PROCscroll 610WHEN 17,18:PROCmessagein 620ENDCASE 630UNTIL end% 640PROCend 650END 660 670DEFPROCend 680SYSreinter,mytask% 690SYS"Wimp_CloseDown",task,mytask% 700END 710ENDPROC 720 730DEFPROCrequest2 740win=!block 750IF win=main% THEN 760!icond=toolbox% 770SYS "Wimp_GetWindowState",,icond 780tool28=icond!28 790!icond=main% 800SYS "Wimp_GetWindowState",,icond 810check=0 820IF icond!4<>block!4 THEN check=1 830IF icond!8<>block!8 THEN check=1 840IF icond!12<>block!12 THEN check=1 850IF icond!16<>block!16 THEN check=1 860IF icond!20<>block!20 THEN check=1 870IF icond!24<>block!24 THEN check=1 880IF block!28=-2 THEN check=1 890IF tool28<>-1 THEN check=1 900IF check=1 THEN SYS "Wimp_OpenWindow",,block:PROCpane 910ELSE 920SYS "Wimp_OpenWindow",,block 930ENDIF 940ENDPROC 950 960DEFPROCrequest3 970CASE !block OF 980WHEN main%: 990SYS "Wimp_CloseWindow",,block 1000!block=toolbox%:SYS "Wimp_CloseWindow",,block:!block=bar%:SYS"Wimp_CloseWindow",,block 1010!block=tinfo%:SYS "Wimp_CloseWindow",,block:!block=iinfo%:SYS "Wimp_CloseWindow",,block 1020!block=found%:SYS "Wimp_CloseWindow",,block:!block=find%:SYS "Wimp_CloseWindow",,block 1030!block=notfnd%:SYS "Wimp_CloseWindow",,block 1040WHEN saved%:IFprequit THEN prequit=FALSE 1050WHEN toolbox%:toolson=FALSE:SYS "Wimp_CloseWindow",,block 1060OTHERWISE :SYS "Wimp_CloseWindow",,block 1070ENDCASE 1080ENDPROC 1090 1100DEFFNicon 1110!icond=-1 1120icond!4=0 1130icond!8=0:icond!12=68:icond!16=68 1140icond!20=%11010+((2^12)*3):icond?23=112 1150$(icond+24)="!DiskTree"+CHR$13 1160SYS "Wimp_CreateIcon",,icond TO icon 1170=icon 1180 1190DEFFNinf(handle,icon) 1200PROCgee(handle,icon) 1210=icond!28 1220 1230DEFFNbit(a$) 1240WHILE INSTR(a$,":")>0 1250a$=MID$(a$,INSTR(a$,":")+1) 1260ENDWHILE 1270WHILE INSTR(a$,".")>0 1280a$=MID$(a$,INSTR(a$,".")+1) 1290ENDWHILE 1300=a$ 1310 1320DEFFNwool(wool%) 1330LOCAL cot$ 1340 WHILE ?wool%>=32 1350cot$+=CHR$(?wool%) 1360wool%+=1 1370ENDWHILE 1380=cot$ 1390 1400DEFFNgetleaf(leaf$) 1410WHILE INSTR(leaf$,".") 1420leaf$=MID$(leaf$,INSTR(leaf$,".")+1) 1430ENDWHILE:=leaf$ 1440 1450DEFFNgetdiskname(path$) 1460REPEAT 1470path$=RIGHT$(path$,LEN(path$)-1) 1480UNTIL LEFT$(path$,1)=":" 1490=RIGHT$(path$,LEN(path$)-1) 1500 1510DEFFNcheckit(hnd%,ic%) 1520!icond=hnd%:icond!4=ic% 1530SYS"Wimp_GetIconState",,icond 1540flags%=icond!24 1550=flags%AND&F0000 1560 1570DEFFNask(fn$) 1580!icond=0:$(icond+4)=fn$+CHR$0 1590SYS"Wimp_ReportError",icond,&13,"!DiskTree" TO ,but 1600=but 1610 1620DEFFNfulls(string$,len) 1630IF LEN(string$)<len THEN 1640REPEAT 1650string$=string$+CHR$0 1660UNTIL LEN(string$)=len 1670ENDIF 1680=string$ 1690 1700DEFFNlongs(string$,len) 1710IF LEN(string$)<len THEN 1720REPEAT 1730string$="0"+string$ 1740UNTIL LEN(string$)=len 1750ENDIF 1760=string$ 1770 1780DEFFNcheckflag(handle,icon,flag) 1790bit=FALSE 1800!icond=handle:icond!4=icon 1810SYS"Wimp_GetIconState",,icond 1820IF (icond!24AND(1<<flag))>0 bit=TRUE 1830=bit 1840 1850DEFFNcaps(up$) 1860FOR L=1 TO LEN(up$) 1870MID$(up$,L,1)=CHR$(ASC(MID$(up$,L,1)) AND &DF) 1880NEXT 1890=up$ 1900 1910DEFPROCtemplate 1920SYS"Wimp_OpenTemplate",,"<DTree$Dir>.Templates" 1930indir=curbuf% 1940info%=FNtemplate("ProgInfo") 1950save%=FNtemplate("save") 1960saved%=FNtemplate("savetext") 1970main%=FNtemplate("tree") 1980toolbox%=FNtemplate("tools") 1990query%=FNtemplate("query") 2000quit%=FNtemplate("quitbox") 2010bar%=FNtemplate("bar") 2020new%=FNtemplate("new") 2030find%=FNtemplate("Find") 2040found%=FNtemplate("found") 2050notfnd%=FNtemplate("notfnd") 2060iinfo%=FNtemplate("info") 2070finfo%=FNtemplate("finfo") 2080tinfo%=FNtemplate("tinfo") 2090SYS "Wimp_CloseTemplate" 2100stex=FNinfo(save%,1) 2110stexd=FNinfo(saved%,1) 2120ENDPROC 2130 2140DEFFNtemplate(a$) 2150SYS"Wimp_LoadTemplate",,block,indir,endbuf%,-1,a$,0 TO ,,indir,,,,c% 2160IF c%=0 THEN PROCmess("Template "+a$+" not found."):END 2170block!64=1 2180SYS"Wimp_CreateWindow",,block TO handle 2190=handle 2200 2210DEFFNinfo(handle,icon) 2220PROCgee(handle,icon) 2230=icond!28 2240 2250DEFPROCinfo(handle,icon,text$) 2260!block=handle:block!4=icon:SYS"Wimp_GetIconState",,block 2270$(block!28)=text$:block!36=LEN(text$)+1 2280block!8=0:block!12=0 2290SYS"Wimp_SetIconState",,block 2300ENDPROC 2310 2320DEFPROCgee(handle,icon) 2330!icond=handle:icond!4=icon 2340SYS"Wimp_GetIconState",,icond 2350ENDPROC 2360 2370DEFPROCseticstate(handle%,ic%,clear,eor):REM as in PRM (CE) 2380!block=handle%:block!4=ic%:block!8=eor:block!12=clear 2390SYS"Wimp_SetIconState",,block 2400ENDPROC 2410 2420DEFPROCcmenus 2430tmopt=-1 2440menuopen=-44 2450menuptr=menu% 2460MOUSE x,y,b 2470trees%=FNmenu("Trees",174,"No Trees") 2480IF ct>-1 THEN PROCtreemens 2490IF toolson THEN toolon$="{�}Tools":ELSE toolon$="Tools" 2500SaveMenu%=FNmenu("Save",5*16,"{b|save%}Text,{b|saved%}Data") 2510misc%=FNmenu("Misc",5*16,"{b|info%}Info,{b|finfo%}File") 2520iconmenu%=FNmenu("!DiskTree",9*16,"{b|misc%}Misc,Tree,New Tree,{b|SaveMenu%}Save,Quit") 2530mainmenu%=FNmenu("!DiskTree",10*16,"{b|misc%}Misc,{b|trees%}Trees,{b|tinfo%}Tree Info,{b|find%}Find,"+toolon$+",New Tree,{b|SaveMenu%}Save,Quit") 2540rmen=block!12:ricon=block!16 2550IF block!12=-2 THEN openmenu%=iconmenu%:a=x-75:b=(5+2)*48:REM No. of items+2*48 2560IF block!12=main% THEN a=x:b=y:openmenu%=mainmenu% 2570IF block!12=toolbox% AND block!16=0 THEN tmopt=0:openmenu%=trees%:a=x:b=y 2580IF block!12=toolbox% AND block!16=1 THEN tmopt=1:openmenu%=trees%:a=x:b=y 2590IF block!12=toolbox% AND block!16=2 THEN tmopt=2:openmenu%=trees%:a=x:b=y 2600PROCseticstate(save%,3,1<<21,0<<21):PROCseticstate(save%,4,1<<21,0<<21) 2610PROCseticstate(saved%,3,1<<21,0<<21) 2620PROCinfo(save%,1,"TextFile") 2630ENDIF 2640PROCopenmenu(a,b) 2650ENDPROC 2660 2670DEFPROCtreemens 2680IF block!12<>toolbox% THEN ENDPROC 2690CASE block!16 OF 2700WHEN 0,2: 2710 j=0 2720 IF block!16=2 THEN $(longdata+(j*13))="�Clear All": j+=1 2730 FOR m=0 TO ct 2740 tick$="" 2750 IF m=st THEN tick$="�" 2760 nextit$=FNgetleaf(troot$(m)) 2770 IF nextit$="$" THEN nextit$=FNgetdiskname(LEFT$(troot$(m),LEN(troot$(m))-2)) 2780 $(longdata+(j*13))=tick$+nextit$ 2790 j+=1 2800 NEXT m 2810 trees%=FNlongmenu("Trees",11*16,j-1,longdata) 2820WHEN 1: 2830 IF NOT arclisted THEN PROCmakearclist:arclisted=TRUE 2840 IF arcct=-1 THEN 2850 treemen$="No Archives" 2860 trees%=FNmenu("Trees",11*16,treemen$) 2870 ELSE 2880 FOR m=0 TO arcct 2890 arcy$=arc$(m) 2900 name$=LEFT$(arcy$,INSTR(arcy$,",")-1) 2910 $(longdata+(m*13))=name$ 2920 NEXT 2930 trees%=FNlongmenu("Trees",11*16,arcct,longdata) 2940 ENDIF 2950ENDCASE 2960ENDPROC 2970 2980DEFPROCopenmenu(x,y) 2990SYS"Wimp_CreateMenu",,openmenu%,x,y 3000ENDPROC 3010 3020DEFFNmenu(tit$,wid,menu$) 3030menu$+="," 3040oldmenu=menuptr 3050$menuptr=tit$ 3060menuptr?12=7 3070menuptr?13=2 3080menuptr?14=7 3090menuptr?15=0 3100menuptr!16=wid 3110menuptr!20=48 3120menuptr!24=0 3130menuptr+=28 3140REPEAT 3150PROCthing(menu$) 3160menu$=MID$(menu$,INSTR(menu$,",")+1) 3170menuptr+=24 3180UNTIL menu$="" 3190menuptr!-24=(menuptr!-24) OR %10000000 3200=oldmenu 3210 3220DEFFNlongmenu(tit$,wid,number,longdata) 3230$longmen=tit$ 3240longmen?12=7 3250longmen?13=2 3260longmen?14=7 3270longmen?15=0 3280longmen!16=wid 3290longmen!20=48 3300longmen!24=0 3310FOR i=0 TO number 3320ptr=(24*i)+28 3330longmen!(ptr)=0 3340longmen!(ptr+4)=-1 3350longmen!(ptr+8)=&07000001 3360data$=$(longdata+(i*13)) 3370IF LEFT$(data$,1)="�" THEN longmen!(ptr)=longmen!(ptr) OR %10:data$=RIGHT$(data$,LEN(data$)-1) 3380IF LEFT$(data$,1)="�" THEN longmen!(ptr)=longmen!(ptr) OR %1:data$=RIGHT$(data$,LEN(data$)-1) 3390$(longmen+(ptr+12))=data$ 3400NEXT 3410longmen!(ptr)=longmen!(ptr) OR %10000000 3420=longmen 3430 3440DEFPROCthing(m$) 3450m$=LEFT$(m$,INSTR(m$,",")-1) 3460i$="":j$="" 3470IF INSTR(m$,"{")>0 THEN 3480i$=LEFT$(m$,INSTR(m$,"}")-1) 3490m$=MID$(m$,INSTR(m$,"}")+1) 3500j$=LEFT$(i$,INSTR(i$,"|")-1) 3510i$=MID$(i$,INSTR(i$,"|")+1) 3520ENDIF 3530ijack=&07000021 3540mjack=0 3550submenu=-1 3560IF INSTR(j$,"b")>0 THEN submenu=EVAL(i$) 3570IF INSTR(j$,"_")>0 THEN mjack=mjack OR 2 3580IF INSTR(j$,"�")>0 THEN mjack=mjack OR 1 3590IF INSTR(j$,"u")>0 THEN mjack=mjack OR 2:submenu=EVAL(i$) 3600!menuptr=mjack 3610menuptr!4=submenu 3620menuptr!8=ijack 3630$(menuptr+12)=m$ 3640ENDIF 3650ENDPROC 3660 3670DEFPROCclick(block) 3680keepb%=block!12 3690IF FNcheckit(block!12,block!16)=983040 THEN 3700PROCslabin(keepb%):PROCslabout(keepb%) 3710ENDIF 3720IF quiting THEN quitin=FALSE:PROCclose(quit%) 3730IF block!12=-2 AND block!8=2 PROCcmenus:ENDPROC 3740IF block!12=-2 AND block!8=4 PROCopenwin(main%):PROCpane 3750IF block!12=-2 AND block!8=1 PROCopenwin(new%):PROCinfo(new%,1,"") 3760IF block!12=main% AND block!8=2 PROCcmenus:ENDPROC 3770IF block!12=save% AND block!16=2 winsave%=block!12:filetype$="file_FFF":PROCdefsave 3780IF block!12=saved% AND block!16=2 winsave%=block!12:filetype$="file_00D":PROCdefsave 3790IF block!12=save% AND block!16=0 winsave%=block!12:PROCsave($FNinfo(winsave%,1)) 3800IF block!12=saved% AND block!16=0 winsave%=block!12:PROCsave($FNinfo(winsave%,1)) 3810IF block!12=save% AND block!16=3 THEN PROCradiosave 3820IF block!12=save% AND block!16=4 THEN PROCradiosave 3830IF block!12=new% AND block!16=2 winsave%=block!12:filetype$="new":PROCdefsave 3840IF block!12=new% AND block!16=4 THEN PROCgo 3850IF block!12=new% AND block!16=5 THEN PROCdrive0 3860IF block!12=main% AND block!8=4 THEN PROCselectitem 3870IF block!12=main% AND block!8=1 THEN PROCselection 3880IF block!12=found% AND block!16=7 THEN found=FALSE:PROCclose(found%) 3890IF block!12=found% AND block!16=6 THEN PROCfind 3900IF block!12=notfnd% AND block!16=3 THEN PROCclose(notfnd%) 3910IF block!12=toolbox% AND block!16=0 THEN PROCcmenus 3920IF block!12=toolbox% AND block!16=1 THEN PROCcmenus 3930IF block!12=toolbox% AND block!16=2 THEN PROCcmenus 3940IF block!12=toolbox% AND block!16=3 AND itemno<>-1 THEN PROCopenwin(iinfo%) 3950IF block!12=toolbox% AND block!16=4 THEN PROCopenwin(new%):PROCinfo(new%,1,"") 3960IF block!12=toolbox% AND block!16=5 THEN PROClast 3970IF block!12=toolbox% AND block!16=6 THEN PROCnext 3980IF block!12=toolbox% AND block!16=7 THEN PROCopenwin(find%) 3990IF block!12=find% AND block!16=16 THEN PROCclose(find%) 4000IF block!12=find% AND block!16=15 THEN PROCfind 4010IF block!12=bar% AND block!16=0 THEN PROCopenwin(tinfo%) 4020IF block!12=query% AND block!16=0 THEN PROCclose(query%):PROCendq 4030IF prequit THEN 4040IF block!12=quit% AND block!16=0 THEN END:SYS"Wimp_ProcessKey",&1FC:SYSreinter,mytask%:SYS"Wimp_CloseDown",task,mytask%:END: 4050IF block!12=quit% AND block!16=2 THEN PROCclose(quit%):prequit=FALSE 4060IF block!12=quit% AND block!16=3 THEN PROCclose(quit%):PROCopenwin(saved%):prequitwait=TRUE 4070IF prequit AND NOT prequitwait prequit=FALSE 4080ELSE 4090IF block!12=quit% AND block!16=0 THEN SYSreinter,mytask%:SYS"Wimp_CloseDown",task,mytask%:END 4100IF block!12=quit% AND block!16=2 THEN PROCclose(quit%) 4110IF block!12=quit% AND block!16=3 THEN PROCclose(quit%):PROCopenwin(saved%):quiting=TRUE 4120ENDIF 4130ENDPROC 4140 4150DEFPROCprocess 4160IF !block=save% AND block!24=13 THEN winsave%=!block:PROCsave($FNinfo(winsave%,1)) 4170IF !block=saved% AND block!24=13 THEN winsave%=!block:PROCsave($FNinfo(winsave%,1)) 4180SYS"Wimp_ProcessKey",block!24 4190ENDPROC 4200 4210DEFPROCselect 4220noway=0 4230SYS"Wimp_DecodeMenu",,openmenu%,block,icond 4240CASE openmenu% OF 4250WHEN mainmenu%,iconmenu%: 4260IF $icond="Quit" THEN PROCareyousure:quiting%=TRUE 4270IF $icond="Tools" AND toolson THEN toolson=FALSE:PROCtoolbox(-1):noway=-1 4280IF $icond="Tools" AND NOT toolson AND noway=0 THEN toolson=TRUE:PROCtoolbox(1) 4290IF $icond="Tree" THEN PROCopenwin(main%):PROCpane 4300IF $icond="New Tree" THEN PROCopenwin(new%):PROCinfo(new%,1,"") 4310IF $icond="Trees.No Tree" THEN SYS"Wimp_CreateMenu",,-1:ENDPROC 4320IF LEFT$($icond,5)="Trees" THEN PROCopentree(block!4) 4330WHEN trees% 4340IF $icond="Clear All" THEN PROCclearall:SYS"Wimp_CreateMenu",,-1:ENDPROC 4350IF $icond="No Trees" THEN SYS"Wimp_CreateMenu",,-1:ENDPROC 4360IF tmopt=0 THEN PROCopentree(!block) 4370IF tmopt=1 THEN PROCopenarc(!block) 4380IF tmopt=2 THEN PROCdelete((!block)-1) 4390ENDCASE 4400SYS"Wimp_GetPointerInfo",,block 4410IF block!8=1 THEN 4420IF menuopen=-44 THEN rc=1:block!16=ricon:block!12=rmen:PROCcmenus 4430SYS"Wimp_CreateMenu",,openmenu% 4440ELSE 4450SYS"Wimp_CreateMenu",,-1 4460ENDIF 4470ENDPROC 4480 4490DEFPROCradiosave 4500done=0 4510IF block!16=3 THEN 4520PROCseticstate(save%,4,1<<21,0<<21) 4530PROCinfo(save%,1,"TextFile") 4540ENDIF 4550IF block!16=4 THEN 4560PROCseticstate(save%,3,1<<21,0<<21) 4570PROCinfo(save%,1,"Selection") 4580ENDIF 4590ENDPROC 4600 4610DEFPROCmess(mess$) 4620!icond=0:$(icond+4)=mess$+CHR$0 4630SYS"Wimp_ReportError",icond,1,"!DiskTree" 4640ENDPROC 4650 4660DEFPROCout 4670PROCdragspr(1) 4680IF winsave%=new% THEN stext=stex:ft=&FFF 4690IF winsave%=save% THEN stext=stex:ft=&FFF 4700IF winsave%=saved% THEN stext=stexd:ft=&00D 4710IF drive%=1 THEN 4720SYS "Wimp_GetPointerInfo",,block 4730ToX=block!0:ToY=block!4:Window=block!12:Icon=block!16 4740mblock!0=256:mblock!12=0:mblock!16=1:REM DataSave 4750mblock!20=Window:mblock!24=Icon:mblock!28=ToX:mblock!32=ToY 4760mblock!36=-1:REM No idea what the size is going to be 4770mblock!40=ft: 4780$stext=$FNinfo(winsave%,1) 4790$stext=FNgetleaf($stext) 4800FOR I=0 TO 255:IF I?stext<32 THEN I?stext=13 4810NEXT 4820$(mblock+44)=FNbit($stext)+CHR$0 4830IF winsave%=new% THEN $(mblock+44)="Directory" 4840SYS "Wimp_SendMessage",17,mblock,Window,Icon:REM DataSave 4850drag%=0 4860ENDIF 4870ENDPROC 4880 4890DEFPROCdefsave 4900PROCMode 4910!block=winsave% 4920SYS "Wimp_GetWindowState",,block 4930ysize%=block!16-block!8 4940x%=block!4:y%=block!8:block!4=2 4950SYS"Wimp_GetIconState",,block 4960block!8+=x%:block!12+=y%+ysize% 4970block!16+=x%:block!20+=y%+ysize% 4980block!24=0:block!28=0:block!32=xmax:block!36=ymax 4990!block=0:block!4=5:drag%=TRUE:drive%=1 5000IF dragspr THEN 5010SYS "DragASprite_Start",%10000101,1,filetype$,block+8 5020PROCdragspr(-1) 5030ELSE 5040SYS"Wimp_DragBox",,block 5050ENDIF 5060ENDPROC 5070 5080DEFPROCMode 5090!block=130:block!4=131:block!8=-1:SYS"OS_ReadVduVariables",block,block+128 5100SYS"OS_ReadModeVariable",MODE,4 TO ,,Xeig% 5110SYS"OS_ReadModeVariable",MODE,5 TO ,,Yeig% 5120xmax=((block!128)+1)*2^Xeig%:ymax=((block!132)+1)*2^Yeig% 5130ENDPROC 5140 5150DEFPROCsave(save$) 5160IF ct=-1 THEN PROCmess("No directory tree data to save!"):ENDPROC 5170IF INSTR(save$,".")<1 AND INSTR(save$,":")<1 AND save$<>"<Wimp$Scrap>" THEN PROCmess("To save, drag the file icon to a directory viewer."):ENDPROC 5180LOCAL ERROR 5190ON ERROR LOCAL IF ERR=71622:PROCquery("Disc Full"):SYS&0D,0,fh%:SYS&406C1:RESTORE ERROR:ENDPROC:ELSE RESTORE ERROR:PROCerror(REPORT$+" : at line "+STR$ERL):SYS&0D,0,fh%:SYS&406C1:ENDPROC 5200IF winsave%=saved% THEN 5210SYS"Hourglass_On" 5220byte=0 5230SYS"OS_Find",&80,save$ TO fh% 5240endt=tblk 5250$endt="DiskTree Data File v�" 5260endt+=LEN("DiskTree Data File v�") 5270SYS"OS_GBPB",2,fh%,tblk,endt-tblk 5280IF FNcheckflag(saved%,3,21) THEN stt=st:ett=st:ELSE stt=0:ett=ct 5290endt=tblk 5300CT$=FNfulls(STR$(ett-stt),3) 5310$endt=CT$ 5320endt+=3 5330SYS"OS_GBPB",2,fh%,tblk,endt-tblk 5340total1%=0:total2%=0 5350FOR k=stt TO ett:total1%+=tcount(k):NEXT k 5360FOR k=stt TO ett 5370total2%+=1 5380SYS"Hourglass_Percentage",total2%/total1%*100 5390ts$=FNfulls(STR$(tsize(k)),7) 5400tl$=FNfulls(STR$(tlen(k)),7) 5410tc$=FNfulls(STR$(tcount(k)),7) 5420rootl$=FNfulls(STR$(LEN(troot$(k))),3) 5430endt=tblk 5440$endt=ts$+tl$+tc$+rootl$ 5450endt+=24 5460SYS"OS_GBPB",2,fh%,tblk,24 5470endt=tblk 5480$endt=troot$(k) 5490endt+=LEN(troot$(k)) 5500SYS"OS_GBPB",2,fh%,tblk,LEN(troot$(k)) 5510SYS"OS_GBPB",2,fh%,tree(k),tsize(k) 5520NEXT k 5530SYS&0D,0,fh% 5540SYS"OS_File",18,save$,&00D 5550IF save$<>"<Wimp$Scrap>" AND NOT FNcheckflag(saved%,3,21) THEN 5560!block=main% 5570SYS"Wimp_GetWindowInfo",,block 5580saved=FALSE 5590$(block!76)=save$:SYS"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 5600PROCinfo(saved%,1,save$) 5610PROCinfo(finfo%,3,"No") 5620ENDIF 5630SYS"Hourglass_Smash" 5640IF quiting SYSreinter,mytask%:SYS"Wimp_CloseDown",task,mytask%:END 5650ENDIF 5660IF winsave%=save% THEN 5670SYS"Hourglass_On" 5680SYS"OS_Find",&80,save$ TO fh% 5690IF FNcheckflag(save%,3,21) THEN stt=st:ett=st:ELSE stt=0:ett=ct 5700total1%=0:total2%=0 5710FOR I=stt TO ett:total1%+=tcount(I):NEXT I 5720FOR I=stt TO ett 5730total2%+=1 5740SYS"Hourglass_Percentage",total2%/total1%*100 5750endt=tblk 5760$endt=" "+troot$(I)+CHR$10+CHR$10 5770endt+=LEN(" "+troot$(I))+2 5780SYS"OS_GBPB",2,fh%,tblk,endt-tblk 5790IF FNcheckflag(save%,4,21) AND s1>-1 THEN stt=tt:ett=tt:stptr=s1:endptr=s2:ELSE stptr=0:endptr=tcount(I)-1 5800 FOR J=stptr TO endptr 5810 n=J*24 5820 t$="" 5830 FOR h=0 TO 2 5840 i=n+h 5850 t$+=CHR$(tree(I)?i) 5860 NEXT h 5870 endt=tblk 5880 FOR h=1 TO VAL(t$) 5890 $endt=" " 5900 endt+=1 5910 NEXT h 5920 t$="" 5930 FOR h=3 TO 12 5940 i=n+h 5950 IF tree(I)?i<>0 THEN t$+=CHR$(tree(I)?i) 5960 NEXT h 5970 $endt=t$+CHR$10 5980 endt+=LEN(t$)+1 5990 SYS"OS_GBPB",2,fh%,tblk,endt-tblk 6000 NEXT J 6010endt=tblk 6020$endt=CHR$10+CHR$10 6030endt+=2 6040SYS"OS_GBPB",2,fh%,tblk,endt-tblk 6050NEXT I 6060SYS&0D,0,fh% 6070SYS"OS_File",18,save$,&FFF 6080CASE save$ OF 6090WHEN "<Wimp$Scrap>" 6100OTHERWISE 6110!block=main% 6120SYS"Wimp_GetWindowInfo",,block 6130saved=FALSE 6140$(block!76)=save$:SYS"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 6150PROCinfo(finfo%,3,"No") 6160ENDCASE 6170SYS"Hourglass_Smash" 6180IF quiting SYSreinter,mytask%:SYS"Wimp_CloseDown",task,mytask%:END 6190ENDIF 6200RESTORE ERROR 6210ENDPROC 6220 6230DEFFNgetbs(fh%,len) 6240string$="" 6250FOR I=1 TO len 6260SYS"OS_BGet",,fh% TO byte 6270string$+=CHR$(byte) 6280NEXT 6290=string$ 6300 6310DEFPROCmessagein 6320sendm=&400E7 6330ref=block!8:task=block!4 6340CASE block!16 OF 6350WHEN 0:PROCend 6360WHEN 2: 6370save$=FNwool(block+44) 6380PROCdragspr(1) 6390IF winsave%=new% THEN PROCdragnew(save$) 6400IF drive%=1 AND winsave%<>new% THEN 6410PROCsave(save$) 6420mblock!0=256 6430mblock!12=ref 6440mblock!16=3 6450mblock!36=-1 6460$(mblock+44)=save$ 6470SYS &400E7,18,mblock,task:REM DataLoad 6480ENDIF 6490WHEN 3: 6500IF block!40=&00d THEN 6510load$=FNwool(block+44):PROCload(load$) 6520ENDPROC 6530ENDIF 6540IF block!40<>&00D THEN 6550load$=FNwool(block+44):PROCnewtree(load$) 6560ENDIF 6570WHEN 5: 6580IF block!40=&00D THEN 6590block!12=block!8:block!16=4 6600SYS sendm,18,block,block!4:REM DataLoadAck 6610PROCload(FNwool(block+44)) 6620ENDIF 6630WHEN 8:IF NOT prequit block!12=ref:SYSsendm,19,block:prequit=TRUE:PROCareyousure 6640ENDCASE 6650ENDPROC 6660 6670DEFPROCload(load$) 6680in=TRUE 6690IF ct=-1 THEN PROCinfo(finfo%,0,load$) 6700SYS"OS_Find",&40,load$ TO load% 6710Len=LEN("DiskTree Data File v�") 6720title$=FNgetbs(load%,Len) 6730IF title$<>"DiskTree Data File v�" THEN PROCquery("This is not a true DiskTree Data file!"):SYS&0D,0,load%:ENDPROC 6740LOCAL ERROR 6750ON ERROR LOCAL IF ERR=388 PROCquery("Out Of Memory "+STR$ERL):SYS&0D,0,load%:RESTORE ERROR:ENDPROC:ELSE RESTORE ERROR:PROCerror(REPORT$+" : at line "+STR$ERL):SYS&0D,0,load%:ENDPROC 6760nof=VAL(FNgetbs(load%,3)) 6770FOR m=0 TO nof 6780TLen=VAL(FNgetbs(load%,7)) 6790TLen%=INT(TLen/8)*8 6800SYS"OS_Heap",1,heap% TO ,,largest,tfree 6810IF TLen%+1024>largest THEN 6820SYS"Wimp_SlotSize",-1,-1 TO current 6830SYS"Wimp_SlotSize",current+(TLen%-largest)+1024,-1 6840SYS"Wimp_SlotSize",-1,-1 TO new 6850change=new-current 6860SYS"OS_Heap",5,heap%,,change 6870hsizeb+=change 6880ENDIF 6890ct+=1 6900tsize(ct)=TLen 6910tlen(ct)=VAL(FNgetbs(load%,7)) 6920tcount(ct)=VAL(FNgetbs(load%,7)) 6930rootl=VAL(FNgetbs(load%,3)) 6940troot$(ct)=FNgetbs(load%,rootl) 6950SYS"OS_Heap",2,heap%,,TLen TO ,,tree(ct) 6960SYS"OS_Heap",1,heap% TO ,,,tfree 6970SYS"OS_GBPB",4,load%,tree(ct),TLen 6980NEXT m 6990SYS&0D,0,load% 7000!icond=main% 7010SYS"Wimp_GetWindowInfo",,icond 7020saved=FALSE:$icond!76=load$:SYS"Wimp_ForceRedraw",-1,icond!4,icond!16,icond!12,icond!16+36 7030SYS"Wimp_CloseWindow",,icond 7040$FNinfo(saved%,1)=load$ 7050st=ct 7060PROCnewview:PROCopenwin(main%):PROCpane 7070PROCinfo(finfo%,1,STR$(ct+1)) 7080PROCinfo(finfo%,2,STR$(hsizeb-tfree)) 7090arclisted=FALSE 7100RESTORE ERROR 7110ENDPROC 7120 7130DEFPROCopenwin(handle%) 7140IF handle%=main% AND ct=-1 THEN PROCquery("No directory trees in memory!"):ENDPROC 7150!block=handle% 7160SYS"Wimp_GetWindowInfo",,block 7170open=block!32 AND (1<<16) 7180front=block!32 AND (1<<17) 7190IF handle%=main% AND width>-1 THEN block!12=block!4+width:block!8=block!16-depth:width=-1 7200IF open=0 THEN 7210SYS"Wimp_OpenWindow",,block 7220ENDIF 7230IF front=0 THEN 7240block!28=-1:SYS"Wimp_OpenWindow",,block 7250ENDIF 7260ENDPROC 7270 7280DEF PROCslabin(handle) 7290!icond=handle 7300SYS "Wimp_GetPointerInfo",,icond 7310SYS "Wimp_BorderIcon",,icond 7320ENDPROC 7330 7340DEF PROCslabout(handle) 7350!icond=handle 7360SYS "Wimp_GetPointerInfo",,icond 7370icond!8=0 7380SYS "Wimp_BorderIcon",,icond 7390ENDPROC 7400 7410DEFPROCredraw(handle) 7420setex=FALSE 7430!block=handle 7440LOCALmore% 7450SYS "Wimp_RedrawWindow",,block TO more% 7460WHILE more% 7470 CASE handle OF 7480 WHEN main% 7490 PROCapplication_redraw 7500 OTHERWISE 7510 SYS"Wimp_BorderWindow",,block 7520 ENDCASE 7530 SYS "Wimp_GetRectangle",,block TO more% 7540 ENDWHILE 7550ENDPROC 7560 7570DEFPROCapplication_redraw 7580workx%=block!4-block!20 7590worky%=block!16-block!24 7600max=block!32-worky% 7610min=block!40-worky% 7620max=(max+46)DIV36*-1 7630min=(min+46)DIV36*-1 7640IF max>tcount(st)-1 THEN max=tcount(st)-1 7650IF ct=-1 THEN ENDPROC 7660tx=workx%:ty=worky%-46-(min*36) 7670g=&400E6 7680n=min*24 7690FOR I=min TO max 7700 SYSg,7 7710 t$="" 7720 FOR h=0 TO 2 7730 i=n+h 7740 t$+=CHR$(tree(st)?i) 7750 NEXT h 7760 len=VAL(t$)-1 7770 IF len=-1 THEN len=0 7780 t$="" 7790 FOR h=3 TO 12 7800 i=n+h 7810 t$+=CHR$(tree(st)?i) 7820 NEXT h 7830 IF itemno=I THEN SYSg,9:RECTANGLE FILL workx%+0,worky%-0-(I*36+46),tlen(st)*16,-30:SYSg,7 7840 IF I>=s1 AND I<=s2-1 THEN SYSg,7:RECTANGLE FILL workx%+0,worky%-0-(I*36+46),tlen(st)*16,-34:SYSg,0 7850 IF I=s2 THEN SYSg,7:RECTANGLE FILL workx%+0,worky%-0-(I*36+46),tlen(st)*16,-30:SYSg,0 7860 IF tree(st)?(i+1)=138 THEN SYSg,8 7870 MOVE tx,ty 7880 PRINT TAB(len)t$ 7890 ty-=36 7900 n+=24 7910NEXT I 7920tyy=worky%-ty-40 7930ENDPROC 7940 7950DEFPROCpane 7960IF ct=-1 THEN ENDPROC 7970bar1=block!4:bar2=block!8:bar3=block!12:bar4=block!16 7980bar5=block!52:bar6=block!20 7990IF toolson THEN PROCall:ELSE PROCbaronly 8000!block=found%:SYS"Wimp_GetWindowInfo",,block 8010open=block!32 AND (1<<16) 8020IF open THEN PROCopenwin(found%) 8030ENDPROC 8040 8050DEFPROCbaronly 8060front=block!28 8070!icond=bar%:SYS"Wimp_GetWindowInfo",,icond 8080icond!4=bar1:icond!8=bar2:icond!12=bar3:icond!16=bar4 8090icond!20=bar6 8100icond!28=front:SYS"Wimp_OpenWindow",,icond 8110block!28=bar%:SYS"Wimp_OpenWindow",,block 8120ENDPROC 8130 8140DEFPROCall 8150front=block!28 8160x1=block!4-94:x2=x1+248:y1=block!8:y2=block!16 8170size=x2-x1 8180!icond=toolbox%:SYS"Wimp_GetWindowInfo",,icond 8190IF x1<0 THEN x1=0:x2=size 8200icond!4=x1:icond!8=y2-570:icond!12=x2:icond!16=y2 8210icond!28=front:SYS"Wimp_OpenWindow",,icond 8220ENDIF 8230!icond=bar%:SYS"Wimp_GetWindowInfo",,icond 8240icond!4=bar1:icond!8=bar2:icond!12=bar3:icond!16=bar4 8250icond!20=bar6 8260icond!28=toolbox%:SYS"Wimp_OpenWindow",,icond 8270block!28=bar%:SYS"Wimp_OpenWindow",,block 8280ENDPROC 8290 8300DEFPROCadjustwin(newxmax,newymin) 8310!icond=bar%:SYS"Wimp_GetWindowInfo",,icond 8320icond!52=newxmax 8330SYS"Wimp_SetExtent",bar%,icond+44 8340!icond=main%:SYS"Wimp_GetWindowInfo",,icond 8350icond!48=newymin:icond!52=newxmax 8360SYS"Wimp_SetExtent",main%,icond+44 8370!icond=bar%:icond!4=0:SYS"Wimp_GetIconState",,icond 8380SYS"Wimp_DeleteIcon",,icond 8390icond=icond+4:icond!12=newxmax+2:!icond=bar% 8400SYS"Wimp_CreateIcon",0,icond TO ic% 8410ENDPROC 8420 8430DEFPROCtoolbox(flag) 8440IF flag=-1 THEN !block=toolbox%:SYS"Wimp_CloseWindow",,block 8450IF flag=1 THEN 8460!block=main% 8470SYS"Wimp_GetWindowState",,block 8480open=block!32 AND (1<<16) 8490IF open<>0 THEN !icond=main%:PROCpane 8500ENDIF 8510ENDPROC 8520 8530DEFPROCerror(err$) 8540!icond=0:$(icond+4)=err$+"."+" Press OK to continue or Cancel to quit"+CHR$0 8550SYS"Wimp_ReportError",icond,3,"!DiskTree" TO ,but 8560IF but=2 THEN SYSreinter,mytask%:SYS"Wimp_CloseDown",task,mytask%:END 8570ENDPROC 8580 8590DEFPROCareyousure 8600IF saved THEN 8610PROCopenwin(quit%) 8620VDU 7 8630PROCinfo(quit%,1,"Your file has been modified.") 8640!block=130:block!4=131:block!8=-1:SYS"OS_ReadVduVariables",block,block+128 8650SYS"OS_ReadModeVariable",MODE,4 TO ,,x 8660SYS"OS_ReadModeVariable",MODE,5 TO ,,y 8670MOUSE RECTANGLE 0,0,(((block!128)+1)*2^x)-1,((block!132)+1)*2^y 8680ENDIF 8690IF NOT saved SYSreinter,mytask%:SYS"Wimp_CloseDown",task,mytask%:END 8700ENDPROC 8710 8720DEFPROCquery(qu$) 8730PROCopenwin(query%) 8740VDU 7 8750!block=query% 8760SYS"Wimp_GetWindowInfo",,block 8770workx%=block!12-block!4 8780worky%=block!16-block!8 8790MOUSE RECTANGLE block!4,block!8,workx%,worky% 8800PROCinfo(query%,1,qu$) 8810ENDPROC 8820 8830DEFPROCendq 8840PROCclose(query%) 8850!block=130:block!4=131:block!8=-1:SYS"OS_ReadVduVariables",block,block+128 8860SYS"OS_ReadModeVariable",MODE,4 TO ,,x 8870SYS"OS_ReadModeVariable",MODE,5 TO ,,y 8880MOUSE RECTANGLE 0,0,(((block!128)+1)*2^x)-1,((block!132)+1)*2^y 8890ENDPROC 8900 8910DEFPROCclose(!block) 8920SYS"Wimp_CloseWindow",,block 8930ENDPROC 8940 8950DEFPROCdragspr(flag) 8960IF dragspr THEN 8970CASE flag OF 8980WHEN 1: 8990!block=winsave%:block!4=2:SYS "Wimp_GetIconState",,block 9000block!8=0:block!12=0:$(block!32)=dindir$ 9010SYS "Wimp_SetIconState",,block 9020SYS "DragASprite_Stop" 9030WHEN -1: 9040!block=winsave%:block!4=2:SYS "Wimp_GetIconState",,block 9050dindir$=$(block!32) 9060block!8=0:block!12=0:$(block!32)=CHR$13 9070SYS "Wimp_SetIconState",,block 9080ENDCASE 9090ENDIF 9100ENDPROC 9110 9120DEFPROCnewtree(file$) 9130IF block!40=4096 OR block!40=8192 THEN 9140path$=file$+"." 9150PROCinfo(new%,1,path$) 9160PROCopenwin(new%) 9170ENDPROC 9180ENDIF 9190path$=FNgetleaf(file$) 9200path$=LEFT$(file$,LEN(file$)-LEN(path$)) 9210PROCinfo(new%,1,path$) 9220ENDPROC 9230 9240DEFPROCdragnew(path$) 9250block!40=4096:path$=LEFT$(path$,LEN(path$)-10) 9260PROCnewtree(path$) 9270ENDPROC 9280 9290DEFPROCdrive0 9300SYS"OS_FSControl",37,"ADFS::0.$",tblk,0,0,1024 TO ,,,,,tlen 9310PROCinfo(new%,1,LEFT$($tblk,1024-tlen)+".") 9320ENDPROC 9330 9340DEFPROCgo 9350IF ct=maxno THEN PROCmess("There is no me free trees available in this file"):ENDPROC 9360arcx=0:prearcx=-1:arcs=FALSE:apps=FALSE 9370arcs=NOT FNcheckflag(new%,0,21) 9380apps=NOT FNcheckflag(new%,3,21) 9390root$=$FNinfo(new%,1) 9400IF root$="" THEN PROCmess("You have not entered a path to catalogue"):ENDPROC 9410root$=LEFT$(root$,LEN(root$)-1) 9420SYS"OS_File",20,root$ TO type 9430IF type<>2 THEN PROCmess("The path to catalogue has not been found"):ENDPROC 9440CASE arcs OF 9450WHEN TRUE: 9460$tblk="ArcFS" 9470SYS"XOS_Module",18,tblk TO r0 9480IF r0<>18 THEN 9490IF FNask("ArcFS not present. Only able to create trees of archives if ArcFS is present. Continue without archives?")=1 THEN arcs=FALSE:ELSE PROCclose(new%):ENDPROC 9500ENDIF 9510ENDCASE 9520SYS"XOS_File",13,root$ TO type 9530IF type<2 AND type>3 THEN PROCquery("Path to create tree from is not a directory/does not exist."):ENDPROC 9540endlisty=0:nlen=0:stop=FALSE 9550botLED=%10:totsize=0 9560count=0 9570ct+=1 9580SYS"Hourglass_On" 9590SYS"OS_Heap",1,heap% TO ,,membuf,tfree 9600membuf=membuf-1024 9610IF membuf<1024 THEN 9620SYS"Wimp_SlotSize",-1,-1 TO current 9630SYS"Wimp_SlotSize",current+(8*1024),-1 9640SYS"Wimp_SlotSize",-1,-1 TO new 9650change=new-current 9660SYS"OS_Heap",5,heap%,,change 9670hsizeb+=change 9680membuf+=change 9690ENDIF 9700SYS"OS_Heap",2,heap%,,membuf TO ,,tree(ct) 9710object=0 9720endtext%=tree(ct) 9730dir$="" 9740x=0 9750lastdir(0)=0 9760start=TIME 9770REPEAT 9780object=lastdir(x) 9790PROCgotree 9800IF stop THEN ENDPROC 9810IF endlisty=1 THEN ENDPROC 9820REPEAT 9830dir$=LEFT$(dir$,(LENdir$)-1) 9840UNTIL MID$(dir$,LENdir$)="." 9850dir$=LEFT$(dir$,(LENdir$)-1) 9860UNTIL FALSE 9870ENDPROC 9880 9890DEFPROCgotree 9900REPEAT 9910SYS"OS_GBPB",10,root$+dir$,buffer,1,object,63 TO ,,,reader,last 9920IF last<>-1 THEN 9930file$="" 9940buff=20 9950REPEAT 9960file$+=CHR$buffer?buff 9970buff+=1 9980UNTILbuffer?buff=0 9990IF LEFT$(file$,1)=CHR$0 file$=RIGHT$(file$,LENfile$-1) 10000length=buffer!8 10010type=buffer!16 10020SYS"OS_File",20,root$+dir$+"."+file$ TO type,,,,,,filetype 10030IF filetype=4096 OR filetype=8192 AND length=-1 THEN length=2048 10040IF type=2 ext$="�" ELSE ext$=CHR$0 10050IF filetype=4096 AND type=3 THEN filet$="DDC":filetype=&DDC 10060IF arcs AND filetype=&DDC ext$="�" 10070nlent=LEN(dir$+file$)-x+1+arcx 10080IF nlent>nlen THEN nlen=nlent 10090predicted=endtext%-tree(ct) 10100IF predicted>membuf-1024 THEN PROCmem 10110IF stop THEN ENDPROC 10120fi$=FNfulls(file$,10) 10130di$=FNfulls(STR$((LENdir$)-x+arcx+1),3) 10140leng$=FNfulls(STR$length,7) 10150filet$=STR$~filetype 10160IF filetype=4096 THEN filet$="DIR" 10170IF filetype=8192 THEN filet$="APP" 10180IF LEN(filet$)<3 THEN REPEAT:filet$="0"+filet$:UNTIL LEN(filet$)=3 10190$endtext%=di$+fi$+ext$+leng$+filet$ 10200endtext%+=24 10210totsize+=length 10220object+=1 10230count+=1 10240IF botLED=%01 THEN botLED=%10 ELSE botLED=%01 10250SYS"Hourglass_LEDs",%11,botLED 10260IF arcs AND filetype=&DDC THEN 10270prearcroot$=root$:prearcdir$=dir$:prearclast=object:lastdir(x)=object:prearcx=x:x+=1 10280OSCLI("OpenArchive "+root$+dir$+"."+file$) 10290root$="ArcFS#"+file$+":$":arcname$=file$:object=0:arcx=LEN(dir$+file$)+1:dir$="" 10300arcct+=1:arc$(arcct)=file$+","+STR$count+","+STR$ct 10310ENDIF 10320IF filetype=4096 dir$=dir$+"."+file$:lastdir(x)=object:x+=1:object=0 10330IF filetype=8192 AND apps dir$=dir$+"."+file$:lastdir(x)=object:x+=1:object=0 10340ENDIF 10350UNTIL reader=0 10360x-=1 10370IF x=-1 AND prearcx=-1 PROCendoflist 10380IF x=prearcx AND prearcx>-1 THEN x=prearcx:root$=prearcroot$:dir$=prearcdir$:object=prearclast:lastdir(x)=object:prearcx=-1:arcx=0:OSCLI("CloseArchive "+arcname$):PROCgotree 10390IF endlisty=1 THEN ENDPROC 10400ENDPROC 10410 10420DEFPROCendoflist 10430finish=TIME-start 10440$endtext%=CHR$17+STR$totsize+CHR$18+STR$finish+CHR$255 10450endtext%+=LEN(STR$totsize+STR$finish)+3 10460tsize(ct)=endtext%-tree(ct) 10470tcount(ct)=count:tlen(ct)=nlen:st=ct:troot$(ct)=root$ 10480SYS"OS_Heap",6,heap%,tree(ct) TO ,,,curb 10490SYS"OS_Heap",4,heap%,tree(ct),(tsize(ct)-curb)+8 TO ,,tree(ct) 10500SYS"Hourglass_Smash" 10510endlisty=1 10520!block=new%:SYS"Wimp_CloseWindow",,block 10530!block=tinfo%:SYS"Wimp_CloseWindow",,block 10540!block=finfo%:SYS"Wimp_CloseWindow",,block 10550!block=iinfo%:SYS"Wimp_CloseWindow",,block 10560PROCinfo(finfo%,1,STR$(ct+1)) 10570PROCinfo(finfo%,2,STR$(hsizeb-tfree)) 10580IF $FNinfo(finfo%,0)="None" THEN PROCinfo(finfo%,0,"<Untitled>") 10590IF saved=FALSE THEN 10600saved=TRUE 10610!icond=main% 10620SYS"Wimp_GetWindowInfo",,icond 10630$(icond!76)=$(icond!76)+" *" 10640SYS"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 10650PROCinfo(finfo%,3,"Yes") 10660ENDIF 10670!block=main%:SYS"Wimp_CloseWindow",,block 10680PROCnewview:PROCopenwin(main%):PROCpane 10690ENDPROC 10700 10710DEFPROCmem 10720SYS"OS_Heap",6,heap%,tree(ct) TO ,,,ohs 10730SYS"OS_ReadMemMapInfo" TO page 10740SYS"Wimp_SlotSize",-1,-1 TO current 10750SYS"Wimp_SlotSize",current+page,-1 10760SYS"Wimp_SlotSize",-1,-1 TO new 10770change=new-current 10780IF change=0 THEN PROCquery("Out Of Memory. Free more memory and try again."):ct-=1:SYS&1D,3,heap%,tree(ct):stop=TRUE:SYS"Hourglass_Smash":ENDPROC 10790SYS"OS_Heap",5,heap%,,change 10800SYS"OS_Heap",4,heap%,tree(ct),change TO ,,tree(ct) 10810SYS"OS_Heap",6,heap%,tree(ct) TO ,,,nhs 10820hsizeb+=change 10830membuf+=nhs-ohs 10840ENDPROC 10850 10860DEFPROCmakearclist 10870FOR j=0 TO maxno: arc$(j)="": NEXT 10880aind=0 10890FOR j=0 TO ct 10900 FOR count=0 TO tcount(j) 10910 index=count*24 10920 type$="" 10930 FOR h=21 TO 23 10940 type$+=CHR$(tree(j)?(index+h)) 10950 NEXT 10960 IF type$="DDC" THEN 10970 t$="" 10980 FOR h=3 TO 12 10990 val=tree(j)?(index+h) 11000 IF val<>0 THEN t$+=CHR$val 11010 NEXT 11020 IF aind<maxno THEN arc$(aind)=t$+","+STR$(count+1)+","+STR$(j):aind+=1 11030 ENDIF 11040 NEXT count 11050NEXT j 11060arcct=aind-1 11070ENDPROC 11080 11090DEFPROClast 11100IF st=0 THEN ENDPROC 11110st-=1 11120!block=main%:SYS"Wimp_CloseWindow",,block 11130PROCnewview 11140PROCopenwin(main%) 11150PROCclose(find%) 11160PROCclose(iinfo%) 11170PROCclose(tinfo%) 11180PROCclose(notfnd%) 11190PROCclose(found%) 11200PROCpane 11210ENDPROC 11220 11230DEFPROCnext 11240IF st=ct THEN ENDPROC 11250st+=1 11260!block=main%:SYS"Wimp_CloseWindow",,block 11270PROCnewview 11280PROCopenwin(main%) 11290PROCclose(find%) 11300PROCclose(iinfo%) 11310PROCclose(tinfo%) 11320PROCclose(notfnd%) 11330PROCclose(found%) 11340PROCpane 11350ENDPROC 11360 11370DEFPROCnewview 11380IF ct=-1 THEN ENDPROC 11390PROCinfo(bar%,0,troot$(st)) 11400tptr=tcount(st)*24+1 11410sizeb$="" 11420REPEAT 11430sizeb$=sizeb$+CHR$(tree(st)?tptr) 11440tptr+=1 11450UNTIL tree(st)?tptr=18 11460tptr+=1 11470finishs$="" 11480REPEAT 11490finishs$=finishs$+CHR$(tree(st)?tptr) 11500tptr+=1 11510UNTIL tree(st)?tptr=255 11520PROCinfo(tinfo%,0,troot$(st)) 11530PROCinfo(tinfo%,1,STR$tcount(st)) 11540PROCinfo(tinfo%,2,STR$tsize(st)) 11550PROCinfo(tinfo%,3,sizeb$) 11560PROCinfo(tinfo%,7,finishs$) 11570xalt=tlen(st)*16:yalt=0-(tcount(st)*36+40) 11580PROCadjustwin(xalt,yalt) 11590itemno=-1 11600PROCseticstate(find%,4,1<<22,1<<22) 11610depth=568 11620IF tcount(st)*36+40<depth THEN depth=tcount(st)*36+40 11630width=tlen(st)*16 11640IF width>500 THEN width=500 11650ENDPROC 11660 11670DEFPROCselectitem 11680olditemno=itemno 11690ycoord=block!4 11700!block=main%:SYS"Wimp_GetWindowInfo",,block 11710workx%=block!4-block!20 11720worky%=block!16-block!24 11730ycoord=0-(block!16-ycoord) 11740ycoord=ycoord+block!24 11750itemno=INT((ycoord-40)/36)*-1-3 11760itemst=st 11770IF olditemno=itemno THEN ENDPROC 11780ycoord=0-(itemno*36+44) 11790SYS"Wimp_ForceRedraw",main%,1,ycoord-32,tlen(st)*16,ycoord 11800ycoord=0-(olditemno*36+44) 11810SYS"Wimp_ForceRedraw",main%,1,ycoord-32,tlen(st)*16,ycoord 11820PROCputinfo(itemno) 11830PROCseticstate(find%,4,1<<22,0<<22) 11840ENDPROC 11850 11860DEFPROCputinfo(itemno) 11870n=itemno*24 11880t$="" 11890FOR h=3 TO 12:i=n+h:t$+=CHR$(tree(st)?i):NEXT h 11900PROCinfo(iinfo%,0,troot$(st)+"..."+t$) 11910t$="" 11920FOR h=14 TO 20:i=n+h:t$+=CHR$(tree(st)?i):NEXT h 11930PROCinfo(iinfo%,4,t$) 11940t$="" 11950FOR h=21 TO 23:i=n+h:t$+=CHR$(tree(st)?i):NEXT h 11960te$="&"+t$+" ("+t$+")" 11970tblk=tt 11980SYS"XOS_FSControl",18,,FNhextodec(t$) TO r0,,r2%,r3% 11990IF r0=18 THEN 12000tblk!0=r2%:tblk!4=r3%:tblk?8=13:type$=$tblk 12010te$=type$+" ("+t$+")" 12020ENDIF 12030st$="sfile_"+t$ 12040IF t$="APP" THEN te$="Application ":st$="sapp" 12050IF t$="DIR" THEN te$="Directory ":st$="sdir" 12060PROCindir(iinfo%,1,"","b0;"+st$) 12070PROCinfo(iinfo%,3,te$) 12080ENDPROC 12090 12100DEFPROCselection 12110olds1=s1:olds2=s2:olditem=ss 12120ycoord=block!4 12130!block=main%:SYS"Wimp_GetWindowInfo",,block 12140workx%=block!4-block!20 12150worky%=block!16-block!24 12160ycoord=0-(block!16-ycoord) 12170ycoord=ycoord+block!24 12180ss=INT((ycoord-40)/36)*-1-3 12190PROCseticstate(save%,4,1<<22,1<<22):PROCseticstate(save%,4,1<<21,0<<21) 12200IF olditem=ss THEN 12210s1=-1:s2=-1 12220ycoord=0-(olds1*36+44) 12230SYS"Wimp_ForceRedraw",main%,1,ycoord-(olds2*36),tlen(st)*16,ycoord 12240ENDPROC 12250ENDIF 12260gap=s2-s1:gap=gap/2 12270IF s1=-1 THEN s1=ss 12280IF ss>s1+gap THEN s2=ss 12290IF ss<s1 THEN s1=ss 12300IF ss<s1+gap THEN s1=ss 12310IF ss=s1+gap THEN s2=ss 12320IF s1>s2 AND s2>-1 THEN sc=s2:s1=s2:s2=sc 12330IF s1>-1 AND s2>-1 THEN PROCseticstate(save%,4,1<<22,0<<22) 12340ycoord=0-(olds1*36+44) 12350SYS"Wimp_ForceRedraw",main%,1,ycoord-(olds2*36),tlen(st)*16,ycoord 12360ycoord=0-(s1*36+44) 12370SYS"Wimp_ForceRedraw",main%,1,ycoord-(s2*36),tlen(st)*16,ycoord 12380ENDPROC 12390 12400DEFPROCindir(handle,icon,text$,indir$) 12410!block=handle:block!4=icon:SYS"Wimp_GetIconState",,block 12420$(block!28)=text$:$(block!32)=indir$:block!36=LEN(indir$)+1 12430block!8=0:block!12=0 12440SYS"Wimp_SetIconState",,block 12450ENDPROC 12460 12470DEFPROCscroll 12480pagesize=INT((block!16-block!8-40)/36) 12490IF block!32=1 THEN block!20=block!20+(tlen(st)*16)/10 12500IF block!32=-1 THEN block!20=block!20-(tlen(st)*16)/10 12510IF block!36=1 THEN topno=INT(block!24/36):block!24=topno*36+36 12520IF block!36=-1 THEN ycoord=0-(block!16-block!8)+block!24:botno=INT((ycoord-40)/36)*-1-3:botno=botno*36+36+40:block!24-=ycoord+botno 12530IF block!32=2 THEN block!20=block!20+(tlen(st)*16)/5 12540IF block!32=-2 THEN block!20=block!20-(tlen(st)*16)/5 12550IF block!36=2 THEN topno=INT(block!24/36)*-1:block!24=0-(topno-pagesize)*36 12560IF block!36=-2 THEN ycoord=(0-(block!16-block!8))+block!24:botno=INT((ycoord-40)/36)*-1-3:botno=(botno+pagesize-1)*36+36+40:block!24-=ycoord+botno 12570SYS"Wimp_OpenWindow",,block 12580ENDPROC 12590 12600DEFPROCdelete(no) 12610done=-1 12620IF no=ct THEN 12630SYS"OS_Heap",3,heap%,tree(ct) 12640SYS"OS_Heap",1,heap% TO ,,largest,tfree 12650SYS"OS_Heap",5,heap%,,0-(largest-1024) 12660hsizeb=hsizeb-(largest-1024) 12670ct-=1 12680done=1 12690ENDIF 12700IF no<>ct AND done=-1 THEN 12710FOR j=no TO ct 12720SYS"OS_Heap",3,heap%,tree(j) 12730NEXT 12740FOR j=no TO ct-1 12750SYS"OS_Heap",2,heap%,,tsize(j+1) TO ,,tree(j) 12760 FOR I=0 TO tsize(j+1) STEP 4 12770 tree(j)!I=tree(j+1)!I 12780 NEXT I 12790tsize(j)=tsize(j+1):tcount(j)=tcount(j+1) 12800tlen(j)=tlen(j+1):troot$(j)=troot$(j+1) 12810NEXT j 12820ct-=1 12830SYS"OS_Heap",1,heap% TO ,,largest,tfree 12840SYS"OS_Heap",5,heap%,,0-(largest-1024) 12850hsizeb=hsizeb-(largest-1024) 12860ENDIF 12870SYS"OS_ReadMemMapInfo" TO page 12880SYS"Wimp_SlotSize",-1,-1 TO current 12890IF largest>page THEN 12900amount=INT((largest-1024)/page)*page 12910IF current-amount<=origappsize THEN amount=current-origappsize 12920SYS"Wimp_SlotSize",current-amount,-1 12930ENDIF 12940IF ct=-1 THEN PROCclearall:ENDPROC 12950IF st>=no THEN st-=1 12960IF st=-1 THEN st=0 12970PROCinfo(finfo%,1,STR$(ct+1)) 12980PROCinfo(finfo%,2,STR$(hsizeb-tfree)) 12990IF saved=FALSE THEN 13000PROCinfo(finfo%,3,"Yes") 13010saved=TRUE 13020!icond=main% 13030SYS"Wimp_GetWindowInfo",,icond 13040$(icond!76)=$(icond!76)+" *" 13050SYS"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 13060ENDIF 13070!block=main%:SYS"Wimp_CloseWindow",,block 13080arclisted=FALSE 13090PROCnewview:PROCopenwin(main%):PROCpane 13100ENDPROC 13110 13120DEFPROCclearall 13130IF ct>-1 THEN 13140FOR I=0 TO ct 13150SYS"OS_Heap",3,heap%,tree(I) 13160NEXT 13170SYS"OS_Heap",1,heap% TO ,,largest,tfree 13180SYS"OS_Heap",5,heap%,,0-(largest-1024) 13190SYS"Wimp_SlotSize",orig,-1 13200ENDIF 13210SYS"OS_Heap",1,heap% TO ,,largest,tfree 13220hsizeb=largest 13230ct=-1 13240!block=main%:SYS"Wimp_GetWindowInfo",,block 13250$(block!76)="<Untitled>" 13260SYS"Wimp_CloseWindow",,block 13270PROCinfo(finfo%,0,"None") 13280PROCinfo(finfo%,1,"0") 13290PROCinfo(finfo%,2,"0") 13300PROCinfo(finfo%,3,"No") 13310saved=FALSE 13320!block=new%:SYS"Wimp_CloseWindow",,block 13330!block=tinfo%:SYS"Wimp_CloseWindow",,block 13340!block=finfo%:SYS"Wimp_CloseWindow",,block 13350!block=iinfo%:SYS"Wimp_CloseWindow",,block 13360!block=bar%:SYS"Wimp_CloseWindow",,block 13370!block=toolbox%:SYS"Wimp_CloseWindow",,block 13380st=0 13390arclisted=FALSE 13400ENDPROC 13410 13420DEFPROCopentree(no) 13430st=no 13440PROCnewview 13450!block=main%:SYS"Wimp_CloseWindow",,block 13460PROCopenwin(main%):PROCpane 13470ENDPROC 13480 13490DEFPROCopenarc(no) 13500use$=arc$(no) 13510str$=LEFT$(use$,INSTR(use$,",")) 13520numb$=RIGHT$(use$,LEN(use$)-INSTR(use$,",")) 13530oct$=LEFT$(numb$,INSTR(numb$,",")-1) 13540x$=RIGHT$(numb$,LENnumb$-LENoct$-1) 13550origt=st 13560st=VAL(x$) 13570PROCgoto(VAL(oct$)-1) 13580ENDPROC 13590 13600DEFPROCgoto(ino) 13610PROCinfo(bar%,0,troot$(st)) 13620tptr=tcount(st)*24+1 13630sizeb$="" 13640REPEAT 13650 sizeb$=sizeb$+CHR$(tree(st)?tptr) 13660 tptr+=1 13670UNTIL tree(st)?tptr=18 13680tptr+=1 13690finishs$="" 13700REPEAT 13710 finishs$=finishs$+CHR$(tree(st)?tptr) 13720 tptr+=1 13730UNTIL tree(st)?tptr=255 13740PROCinfo(tinfo%,0,troot$(st)) 13750PROCinfo(tinfo%,1,STR$tcount(st)) 13760PROCinfo(tinfo%,2,STR$tsize(st)) 13770PROCinfo(tinfo%,3,sizeb$) 13780PROCinfo(tinfo%,7,finishs$) 13790IF uptot>-1 AND uptot<>origt THEN PROCnewview 13800!block=main%:SYS"Wimp_CloseWindow",,block 13810PROCopenwin(main%):PROCpane 13820!block=main%:SYS"Wimp_GetWindowInfo",,block 13830workx%=block!4-block!20 13840worky%=block!16-block!24 13850ycoord=0-(itemno*36+44) 13860itemno=ino 13870block!24=0-((itemno-2)*36+44) 13880SYS"Wimp_OpenWindow",,block 13890SYS"Wimp_ForceRedraw",main%,1,ycoord-32,tlen(st)*16,ycoord 13900ENDPROC 13910 13920DEFPROCfind 13930PROCclose(find%) 13940PROCclose(found%) 13950IF FNcheckflag(find%,1,21) THEN opt=1 13960IF FNcheckflag(find%,6,21) THEN opt=2 13970IF FNcheckflag(find%,9,21) THEN opt=3 13980from=0 13990IF FNcheckflag(find%,17,21) THEN sttree=st:endtree=st ELSE sttree=0:endtree=ct 14000IF FNcheckflag(find%,4,21) AND from>-1 THEN from=itemno:sttree=itemst 14010origt=st 14020IF NOT found THEN 14030nonefnd=-1 14040totalcnt=0 14050FOR n=sttree TO endtree 14060totalcnt=+tcount(n) 14070NEXT n 14080nowon=0 14090ENDIF 14100CASE opt OF 14110WHEN 1: 14120search$=$FNinfo(find%,2) 14130tex$=search$:tex2$="Name :-" 14140search$=FNfulls(search$,10) 14150case=FNcheckflag(find%,3,21) 14160IF NOT case THEN search$=FNcaps(search$) 14170IF found AND FNcheckflag(find%,18,21) THEN sttree=uptot 14180FOR ontree=sttree TO endtree 14190IF found THEN from=upto+1:found=FALSE 14200st=ontree 14210n=from*24 14220SYS"Hourglass_On" 14230FOR I=from TO tcount(st) 14240 nowon+=1 14250 t$="" 14260 FOR h=3 TO 12 14270 i=n+h 14280 t$+=CHR$(tree(st)?i) 14290 NEXT h 14300 IF NOT case THEN t$=FNcaps(t$) 14310 IF t$=search$ THEN SYS"Hourglass_Smash":nonefnd=1:upto=I:uptot=ontree:PROCgoto(I):PROCfound(I,st):ENDPROC 14320 n+=24 14330 SYS"Hourglass_Percentage",nowon/totalcnt*100 14340NEXT I 14350from=0:upto=0 14360NEXT ontree 14370SYS"Hourglass_Smash" 14380ENDIF 14390WHEN 2: 14400Search$=$FNinfo(find%,7) 14410IF LEFT$(Search$,1)="&" THEN 14420search$=Search$ 14430search$=RIGHT$(search$,LEN(search$)-1) 14440IF LENsearch$>3 THEN search$=LEFT$(search$,3) 14450IF LENsearch$<3 THEN search$=FNlongs(search$,3) 14460tex$="&"+search$:tex2$="Type :-" 14470ENDIF 14480IF LEFT$(Search$,1)<>"&" THEN 14490search$=Search$ 14500SYS"XOS_FSControl",31,search$ TO r0,,filetype 14510IF r0<>31 THEN PROCmess("File type not recognised; Try entering file type number"):ENDPROC 14520search$=STR$~filetype 14530IF LENsearch$<3 THEN search$=FNlongs(search$,3) 14540tex$="&"+search$:tex2$="Type :-" 14550ENDIF 14560IF found AND FNcheckflag(find%,18,21) THEN sttree=uptot 14570 FOR ontree=sttree TO endtree 14580 IF found THEN from=upto+1:found=FALSE 14590 st=ontree 14600 n=from*24 14610 SYS"Hourglass_On" 14620 FOR I=from TO tcount(st) 14630 nowon+=1 14640 t$="" 14650 FOR h=21 TO 23 14660 i=n+h 14670 t$+=CHR$(tree(st)?i) 14680 NEXT h 14690 IF t$=search$ THEN SYS"Hourglass_Smash":nonefnd=1:upto=I:uptot=ontree:PROCgoto(I):PROCfound(I,st):ENDPROC 14700 n+=24 14710 SYS"Hourglass_Percentage",nowon/totalcnt*100 14720 NEXT I 14730from=0:upto=0 14740NEXT ontree 14750SYS"Hourglass_Smash" 14760ENDIF 14770WHEN 3: 14780search$=$FNinfo(find%,11) 14790search2$=$FNinfo(find%,12) 14800search=VAL(search$)*1000 14810search2=VAL(search2$)*1000 14820tex$=STR$((search+search2)/2):tex2$="Size :-" 14830search$=FNfulls(search$,10) 14840IF found AND FNcheckflag(find%,18,21) THEN sttree=uptot 14850FOR ontree=sttree TO endtree 14860IF found THEN from=upto+1:found=FALSE 14870st=ontree 14880n=from*24 14890SYS"Hourglass_On" 14900FOR I=from TO tcount(st) 14910 nowon+=1 14920 t$="" 14930 FOR h=14 TO 20 14940 i=n+h 14950 t$+=CHR$(tree(st)?i) 14960 NEXT h 14970 t=VAL(t$) 14980 IF t>search AND t<search2 THEN SYS"Hourglass_Smash":nonefnd=1:upto=I:uptot=ontree:PROCgoto(I):PROCfound(I,st):ENDPROC 14990 n+=24 15000 SYS"Hourglass_Percentage",nowon/totalcnt*100 15010NEXT I 15020from=0:upto=0 15030NEXT ontree 15040SYS"Hourglass_Smash" 15050ENDIF 15060ENDCASE 15070st=origt 15080PROCinfo(notfnd%,1,tex$) 15090PROCinfo(notfnd%,2,tex2$) 15100PROCopenwin(notfnd%) 15110found=FALSE 15120ENDPROC 15130 15140DEFPROCfound(item,trno) 15150n=item*24 15160t$="" 15170FOR h=3 TO 12:i=n+h:t$+=CHR$(tree(st)?i):NEXT h 15180PROCinfo(found%,3,t$) 15190t$="" 15200FOR h=14 TO 20:i=n+h:t$+=CHR$(tree(st)?i):NEXT h:size$=t$ 15210t$="" 15220FOR h=21 TO 23:i=n+h:t$+=CHR$(tree(st)?i):NEXT h 15230te$="&"+t$+" ("+t$+")" 15240tblk=tt 15250SYS"XOS_ReadVarVal","File$Type_"+t$,tblk,512 TO ,,br 15260IF br<>0 THEN 15270type$="" 15280FOR s=0 TO br-1 15290type$+=CHR$tblk?s 15300NEXT s 15310IF LEN(type$)<8 THEN 15320REPEAT 15330type$=type$+" " 15340UNTIL LEN(type$)=8 15350ENDIF 15360te$=type$+" ("+t$+")" 15370ENDIF 15380st$="sfile_"+t$ 15390IF t$="APP" THEN te$="Application ":st$="sapp" 15400IF t$="DIR" THEN te$="Directory ":st$="sdir" 15410PROCindir(found%,1,"","b0;"+st$) 15420IF opt=1 OR opt=2 PROCinfo(found%,2,"Type"):PROCinfo(found%,4,te$):REMte$ 15430IF opt=3 PROCinfo(found%,2,"Size"):PROCinfo(found%,4,size$) 15440PROCopenwin(found%) 15450found=TRUE 15460PROCputinfo(item) 15470ENDPROC 15480 15490DEFFNhextodec(string$) 15500total=0 15510strlen=LENstring$ 15520FOR I=strlen-1 TO 0 STEP -1 15530 next$=LEFT$(string$,1) 15540 val=-1 15550 IF next$="0" THEN val=0 15560 IF next$="1" THEN val=1 15570 IF next$="2" THEN val=2 15580 IF next$="3" THEN val=3 15590 IF next$="4" THEN val=4 15600 IF next$="5" THEN val=5 15610 IF next$="6" THEN val=6 15620 IF next$="7" THEN val=7 15630 IF next$="8" THEN val=8 15640 IF next$="9" THEN val=9 15650 IF next$="A" OR next$="a" THEN val=10 15660 IF next$="B" OR next$="b" THEN val=11 15670 IF next$="C" OR next$="c" THEN val=12 15680 IF next$="D" OR next$="d" THEN val=13 15690 IF next$="E" OR next$="e" THEN val=14 15700 IF next$="F" OR next$="f" THEN val=15 15710 IF val=-1 THEN val=0 15720 total+=val*16^I 15730 string$=RIGHT$(string$,LEN(string$)-1) 15740NEXT 15750=total
$� � �mess(�$+" : at line "+Þ):� � *>$.!DiskTree.!RunImage :� *Main Program for !DiskTree - Directory Tree Creator (� *Version 1.08 (1 Feb '96) 2� *Authur � J. Robbins < maxno=150 FE� block &1000, menu% 2048, curbuf% 7*1024, icond 2048, mblock 256 P3� longdata (maxno*13)+24, longmen (maxno*24)+48 Z2� tree(maxno),lastdir(256),buffer 63,tblk 1024 dF� tsize(maxno),tcount(maxno),tlen(maxno),troot$(maxno),arc$(maxno) nendbuf%=curbuf%+&6000 xLend%=-1:toolson=�:quiting=�:totallen=0:found=�:upto=-1:uptot=-1:oldst=-1 �>saved=�:prequitwait=�:prequit=�:sel=-1:tt=tblk:arclisted=� �Lin=�:started=0:ct=-1:arcct=-1:width=-1:itemno=-1:rc=-1:s1=-1:s2=-1:ss=-1 �task=&4B534154 �@ș "Wimp_Initialise",200,task,"!DiskTree" � version%,mytask% �$ș "Wimp_ClaimInterface",mytask% �reinter=&81683 � �template �Sș"XOS_ReadVarVal","DTree$Drag",block,256,0,0 � ,,len:block?len=13:drag$=$block �*� drag$="TRUE" � dragspr=� � dragspr=� �env$="" �ș "OS_GetEnv" � env$ �� �env$,"-quit") � �I%=�env$,"""") I%=�env$,"""",I%+1) � I%+=1 "� �env$,I%,1)<>" " ,env$=�env$,I%) 6� @initic=�icon J"ș"Wimp_SlotSize",-1,-1 � orig T max=�-�:max=�(max/1024)*1024 ^max-=&4000 hend%=�:drag%=0:drive%=0 r%ș"Wimp_SlotSize",-1,-1 � current |�=�-max:hsizeb=max:heap%=� �� hsizeb<1024 � � �ș"OS_Heap",0,heap%,,hsizeb �'origheap=hsizeb:origappsize=current �#� � �error(�$+" : at line "+Þ) ��info(bar%,0,"None") ��adjustwin(500,-500) �$�seticstate(save%,4,1<<22,1<<22) �$�seticstate(find%,4,1<<22,1<<22) �� env$<>"" �load(env$) �� �%ș"Wimp_Poll",0,block � eventcode �-ș "Wimp_PollPointer",eventcode,,version% �Ȏ eventcode � 4� 0:� � saved � prequit ș"Wimp_ProcessKey",&1FC � 1:�redraw(block!0) � 2:�request2 &� 3:�request3 0� 6:�click(block) :� 7:�out D� 8:�process N� 9:�select X� 10:�scroll b� 17,18:�messagein l� v � end% ��end �� � � ��end �șreinter,mytask% �#ș"Wimp_CloseDown",task,mytask% �� �� � ���request2 �win=!block �� win=main% � �!icond=toolbox% #ș "Wimp_GetWindowState",,icond tool28=icond!28 !icond=main% #ș "Wimp_GetWindowState",,icond *check=0 4 � icond!4<>block!4 � check=1 > � icond!8<>block!8 � check=1 H"� icond!12<>block!12 � check=1 R"� icond!16<>block!16 � check=1 \"� icond!20<>block!20 � check=1 f"� icond!24<>block!24 � check=1 p� block!28=-2 � check=1 z� tool28<>-1 � check=1 �1� check=1 � ș "Wimp_OpenWindow",,block:�pane �� �ș "Wimp_OpenWindow",,block �� �� � ���request3 �Ȏ !block � �� main%: � ș "Wimp_CloseWindow",,block �X!block=toolbox%:ș "Wimp_CloseWindow",,block:!block=bar%:ș"Wimp_CloseWindow",,block �Y!block=tinfo%:ș "Wimp_CloseWindow",,block:!block=iinfo%:ș "Wimp_CloseWindow",,block �X!block=found%:ș "Wimp_CloseWindow",,block:!block=find%:ș "Wimp_CloseWindow",,block /!block=notfnd%:ș "Wimp_CloseWindow",,block !� saved%:�prequit � prequit=� 5� toolbox%:toolson=�:ș "Wimp_CloseWindow",,block $# :ș "Wimp_CloseWindow",,block .� 8� B L ݤicon V !icond=-1 ` icond!4=0 j%icond!8=0:icond!12=68:icond!16=68 t+icond!20=%11010+((2^12)*3):icond?23=112 ~$(icond+24)="!DiskTree"+�13 �&ș "Wimp_CreateIcon",,icond � icon � =icon � �ݤinf(handle,icon) ��gee(handle,icon) � =icond!28 � � ݤbit(a$) �ȕ �a$,":")>0 �a$=�a$,�a$,":")+1) �� �ȕ �a$,".")>0 a$=�a$,�a$,".")+1) � =a$ (ݤwool(wool%) 2 � cot$ < ȕ ?wool%>=32 Fcot$+=�(?wool%) Pwool%+=1 Z� d =cot$ n xݤgetleaf(leaf$) �ȕ �leaf$,".") �leaf$=�leaf$,�leaf$,".")+1) ��:=leaf$ � �ݤgetdiskname(path$) �� �path$=�path$,�(path$)-1) �� �path$,1)=":" �=�path$,�(path$)-1) � �ݤcheckit(hnd%,ic%) �!icond=hnd%:icond!4=ic% � ș"Wimp_GetIconState",,icond flags%=icond!24 =flags%�&F0000 "ݤask(fn$) ,!icond=0:$(icond+4)=fn$+�0 65ș"Wimp_ReportError",icond,&13,"!DiskTree" � ,but @=but J Tݤfulls(string$,len) ^� �(string$)<len � h� rstring$=string$+�0 |� �(string$)=len �� �=string$ � �ݤlongs(string$,len) �� �(string$)<len � �� �string$="0"+string$ �� �(string$)=len �� �=string$ � �!ݤcheckflag(handle,icon,flag) � bit=� !icond=handle:icond!4=icon ș"Wimp_GetIconState",,icond "� (icond!24�(1<<flag))>0 bit=� &=bit 0 :ݤcaps(up$) D� L=1 � �(up$) N#�up$,L,1)=�(�(�up$,L,1)) � &DF) X� b=up$ l v��template �2ș"Wimp_OpenTemplate",,"<DTree$Dir>.Templates" �indir=curbuf% �info%=�template("ProgInfo") �save%=�template("save") � saved%=�template("savetext") �main%=�template("tree") �toolbox%=�template("tools") �query%=�template("query") �quit%=�template("quitbox") �bar%=�template("bar") �new%=�template("new") �find%=�template("Find") �found%=�template("found") notfnd%=�template("notfnd") iinfo%=�template("info") finfo%=�template("finfo") tinfo%=�template("tinfo") *ș "Wimp_CloseTemplate" 4stex=�info(save%,1) >stexd=�info(saved%,1) H� R \ݤtemplate(a$) fFș"Wimp_LoadTemplate",,block,indir,endbuf%,-1,a$,0 � ,,indir,,,,c% p2� c%=0 � �mess("Template "+a$+" not found."):� zblock!64=1 �)ș"Wimp_CreateWindow",,block � handle �=handle � �ݤinfo(handle,icon) ��gee(handle,icon) � =icond!28 � ���info(handle,icon,text$) �;!block=handle:block!4=icon:ș"Wimp_GetIconState",,block �)$(block!28)=text$:block!36=�(text$)+1 �block!8=0:block!12=0 � ș"Wimp_SetIconState",,block �� ��gee(handle,icon) !icond=handle:icond!4=icon $ ș"Wimp_GetIconState",,icond .� 8 B8��seticstate(handle%,ic%,clear,eor):� as in PRM (CE) L9!block=handle%:block!4=ic%:block!8=eor:block!12=clear V ș"Wimp_SetIconState",,block `� j t��cmenus ~tmopt=-1 �menuopen=-44 �menuptr=menu% �ȗ x,y,b �(trees%=�menu("Trees",174,"No Trees") �� ct>-1 � �treemens �4� toolson � toolon$="{�}Tools":� toolon$="Tools" �?SaveMenu%=�menu("Save",5*16,"{b|save%}Text,{b|saved%}Data") �;misc%=�menu("Misc",5*16,"{b|info%}Info,{b|finfo%}File") �Ziconmenu%=�menu("!DiskTree",9*16,"{b|misc%}Misc,Tree,New Tree,{b|SaveMenu%}Save,Quit") �mainmenu%=�menu("!DiskTree",10*16,"{b|misc%}Misc,{b|trees%}Trees,{b|tinfo%}Tree Info,{b|find%}Find,"+toolon$+",New Tree,{b|SaveMenu%}Save,Quit") � rmen=block!12:ricon=block!16 �M� block!12=-2 � openmenu%=iconmenu%:a=x-75:b=(5+2)*48:� No. of items+2*48 2� block!12=main% � a=x:b=y:openmenu%=mainmenu% G� block!12=toolbox% � block!16=0 � tmopt=0:openmenu%=trees%:a=x:b=y G� block!12=toolbox% � block!16=1 � tmopt=1:openmenu%=trees%:a=x:b=y G� block!12=toolbox% � block!16=2 � tmopt=2:openmenu%=trees%:a=x:b=y (E�seticstate(save%,3,1<<21,0<<21):�seticstate(save%,4,1<<21,0<<21) 2%�seticstate(saved%,3,1<<21,0<<21) <�info(save%,1,"TextFile") F� P�openmenu(a,b) Z� d n��treemens x� block!12<>toolbox% � � �Ȏ block!16 � � � 0,2: � j=0 �9 � block!16=2 � $(longdata+(j*13))="�Clear All": j+=1 � � m=0 � ct � tick$="" � � m=st � tick$="�" � nextit$=�getleaf(troot$(m)) �E � nextit$="$" � nextit$=�getdiskname(�troot$(m),�(troot$(m))-2)) �% $(longdata+(j*13))=tick$+nextit$ � j+=1 � � m �1 trees%=�longmenu("Trees",11*16,j-1,longdata) � 1: - � � arclisted � �makearclist:arclisted=� � arcct=-1 � " treemen$="No Archives" ,* trees%=�menu("Trees",11*16,treemen$) 6 � @ � m=0 � arcct J arcy$=arc$(m) T! name$=�arcy$,�arcy$,",")-1) ^ $(longdata+(m*13))=name$ h � r4 trees%=�longmenu("Trees",11*16,arcct,longdata) | � �� �� � ���openmenu(x,y) �&ș"Wimp_CreateMenu",,openmenu%,x,y �� � �ݤmenu(tit$,wid,menu$) �menu$+="," �oldmenu=menuptr �$menuptr=tit$ �menuptr?12=7 �menuptr?13=2 menuptr?14=7 menuptr?15=0 menuptr!16=wid &menuptr!20=48 0menuptr!24=0 :menuptr+=28 D� N�thing(menu$) Xmenu$=�menu$,�menu$,",")+1) bmenuptr+=24 l� menu$="" v)menuptr!-24=(menuptr!-24) � %10000000 �=oldmenu � �(ݤlongmenu(tit$,wid,number,longdata) �$longmen=tit$ �longmen?12=7 �longmen?13=2 �longmen?14=7 �longmen?15=0 �longmen!16=wid �longmen!20=48 �longmen!24=0 �� i=0 � number �ptr=(24*i)+28 longmen!(ptr)=0 longmen!(ptr+4)=-1 longmen!(ptr+8)=&07000001 data$=$(longdata+(i*13)) *P� �data$,1)="�" � longmen!(ptr)=longmen!(ptr) � %10:data$=�data$,�(data$)-1) 4O� �data$,1)="�" � longmen!(ptr)=longmen!(ptr) � %1:data$=�data$,�(data$)-1) >$(longmen+(ptr+12))=data$ H� R+longmen!(ptr)=longmen!(ptr) � %10000000 \=longmen f p��thing(m$) zm$=�m$,�m$,",")-1) �i$="":j$="" �� �m$,"{")>0 � �i$=�m$,�m$,"}")-1) �m$=�m$,�m$,"}")+1) �j$=�i$,�i$,"|")-1) �i$=�i$,�i$,"|")+1) �� �ijack=&07000021 �mjack=0 �submenu=-1 � � �j$,"b")>0 � submenu=�(i$) �"� �j$,"_")>0 � mjack=mjack � 2 �"� �j$,"�")>0 � mjack=mjack � 1 0� �j$,"u")>0 � mjack=mjack � 2:submenu=�(i$) !menuptr=mjack menuptr!4=submenu $menuptr!8=ijack .$(menuptr+12)=m$ 8� B� L V��click(block) `keepb%=block!12 j*� �checkit(block!12,block!16)=983040 � t$�slabin(keepb%):�slabout(keepb%) ~� �&� quiting � quitin=�:�close(quit%) �'� block!12=-2 � block!8=2 �cmenus:� �3� block!12=-2 � block!8=4 �openwin(main%):�pane �=� block!12=-2 � block!8=1 �openwin(new%):�info(new%,1,"") �*� block!12=main% � block!8=2 �cmenus:� �Q� block!12=save% � block!16=2 winsave%=block!12:filetype$="file_FFF":�defsave �R� block!12=saved% � block!16=2 winsave%=block!12:filetype$="file_00D":�defsave �M� block!12=save% � block!16=0 winsave%=block!12:�save($�info(winsave%,1)) �N� block!12=saved% � block!16=0 winsave%=block!12:�save($�info(winsave%,1)) �.� block!12=save% � block!16=3 � �radiosave �.� block!12=save% � block!16=4 � �radiosave �K� block!12=new% � block!16=2 winsave%=block!12:filetype$="new":�defsave &� block!12=new% � block!16=4 � �go *� block!12=new% � block!16=5 � �drive0 .� block!12=main% � block!8=4 � �selectitem -� block!12=main% � block!8=1 � �selection (;� block!12=found% � block!16=7 � found=�:�close(found%) 2*� block!12=found% � block!16=6 � �find <5� block!12=notfnd% � block!16=3 � �close(notfnd%) F.� block!12=toolbox% � block!16=0 � �cmenus P.� block!12=toolbox% � block!16=1 � �cmenus Z.� block!12=toolbox% � block!16=2 � �cmenus dD� block!12=toolbox% � block!16=3 � itemno<>-1 � �openwin(iinfo%) nF� block!12=toolbox% � block!16=4 � �openwin(new%):�info(new%,1,"") x,� block!12=toolbox% � block!16=5 � �last �,� block!12=toolbox% � block!16=6 � �next �6� block!12=toolbox% � block!16=7 � �openwin(find%) �2� block!12=find% � block!16=16 � �close(find%) �*� block!12=find% � block!16=15 � �find �3� block!12=bar% � block!16=0 � �openwin(tinfo%) �9� block!12=query% � block!16=0 � �close(query%):�endq �� prequit � �s� block!12=quit% � block!16=0 � �:ș"Wimp_ProcessKey",&1FC:șreinter,mytask%:ș"Wimp_CloseDown",task,mytask%:�: �;� block!12=quit% � block!16=2 � �close(quit%):prequit=� �P� block!12=quit% � block!16=3 � �close(quit%):�openwin(saved%):prequitwait=� �'� prequit � � prequitwait prequit=� �� �W� block!12=quit% � block!16=0 � șreinter,mytask%:ș"Wimp_CloseDown",task,mytask%:� 1� block!12=quit% � block!16=2 � �close(quit%) L� block!12=quit% � block!16=3 � �close(quit%):�openwin(saved%):quiting=� � "� , 6 ��process @L� !block=save% � block!24=13 � winsave%=!block:�save($�info(winsave%,1)) JM� !block=saved% � block!24=13 � winsave%=!block:�save($�info(winsave%,1)) T ș"Wimp_ProcessKey",block!24 ^� h r��select |noway=0 �.ș"Wimp_DecodeMenu",,openmenu%,block,icond �Ȏ openmenu% � �� mainmenu%,iconmenu%: �,� $icond="Quit" � �areyousure:quiting%=� �@� $icond="Tools" � toolson � toolson=�:�toolbox(-1):noway=-1 �B� $icond="Tools" � � toolson � noway=0 � toolson=�:�toolbox(1) �+� $icond="Tree" � �openwin(main%):�pane �9� $icond="New Tree" � �openwin(new%):�info(new%,1,"") �8� $icond="Trees.No Tree" � ș"Wimp_CreateMenu",,-1:� �-� �$icond,5)="Trees" � �opentree(block!4) �� trees% �>� $icond="Clear All" � �clearall:ș"Wimp_CreateMenu",,-1:� �3� $icond="No Trees" � ș"Wimp_CreateMenu",,-1:� !� tmopt=0 � �opentree(!block) � tmopt=1 � �openarc(!block) #� tmopt=2 � �delete((!block)-1) &� 0"ș"Wimp_GetPointerInfo",,block :� block!8=1 � D>� menuopen=-44 � rc=1:block!16=ricon:block!12=rmen:�cmenus N"ș"Wimp_CreateMenu",,openmenu% X� bș"Wimp_CreateMenu",,-1 l� v� � ���radiosave � done=0 �� block!16=3 � �$�seticstate(save%,4,1<<21,0<<21) ��info(save%,1,"TextFile") �� �� block!16=4 � �$�seticstate(save%,3,1<<21,0<<21) ��info(save%,1,"Selection") �� �� � ��mess(mess$) !icond=0:$(icond+4)=mess$+�0 ,ș"Wimp_ReportError",icond,1,"!DiskTree" � * 4 ��out >�dragspr(1) H(� winsave%=new% � stext=stex:ft=&FFF R)� winsave%=save% � stext=stex:ft=&FFF \+� winsave%=saved% � stext=stexd:ft=&00D f� drive%=1 � p#ș "Wimp_GetPointerInfo",,block z9ToX=block!0:ToY=block!4:Window=block!12:Icon=block!16 �3mblock!0=256:mblock!12=0:mblock!16=1:� DataSave �?mblock!20=Window:mblock!24=Icon:mblock!28=ToX:mblock!32=ToY �7mblock!36=-1:� No idea what the size is going to be �mblock!40=ft: �$stext=$�info(winsave%,1) �$stext=�getleaf($stext) �)� I=0 � 255:� I?stext<32 � I?stext=13 �� � $(mblock+44)=�bit($stext)+�0 �.� winsave%=new% � $(mblock+44)="Directory" �:ș "Wimp_SendMessage",17,mblock,Window,Icon:� DataSave �drag%=0 �� � ��defsave $ �Mode .!block=winsave% 8#ș "Wimp_GetWindowState",,block Bysize%=block!16-block!8 L#x%=block!4:y%=block!8:block!4=2 V ș"Wimp_GetIconState",,block `#block!8+=x%:block!12+=y%+ysize% j$block!16+=x%:block!20+=y%+ysize% t5block!24=0:block!28=0:block!32=xmax:block!36=ymax ~'!block=0:block!4=5:drag%=�:drive%=1 �� dragspr � �8ș "DragASprite_Start",%10000101,1,filetype$,block+8 ��dragspr(-1) �� �ș"Wimp_DragBox",,block �� �� � � ��Mode �M!block=130:block!4=131:block!8=-1:ș"OS_ReadVduVariables",block,block+128 �)ș"OS_ReadModeVariable",�,4 � ,,Xeig% �)ș"OS_ReadModeVariable",�,5 � ,,Yeig% =xmax=((block!128)+1)*2^Xeig%:ymax=((block!132)+1)*2^Yeig% � ��save(save$) (8� ct=-1 � �mess("No directory tree data to save!"):� 2{� �save$,".")<1 � �save$,":")<1 � save$<>"<Wimp$Scrap>" � �mess("To save, drag the file icon to a directory viewer."):� <� � F{� � � � �=71622:�query("Disc Full"):ș&0D,0,fh%:ș&406C1:� �:�:� � �:�error(�$+" : at line "+Þ):ș&0D,0,fh%:ș&406C1:� P� winsave%=saved% � Zș"Hourglass_On" d byte=0 nș"OS_Find",&80,save$ � fh% x endt=tblk �!$endt="DiskTree Data File v�" �$endt+=�("DiskTree Data File v�") �$ș"OS_GBPB",2,fh%,tblk,endt-tblk �<� �checkflag(saved%,3,21) � stt=st:ett=st:� stt=0:ett=ct � endt=tblk �CT$=�fulls(�(ett-stt),3) � $endt=CT$ �endt+=3 �$ș"OS_GBPB",2,fh%,tblk,endt-tblk �total1%=0:total2%=0 �(� k=stt � ett:total1%+=tcount(k):� k �� k=stt � ett �total2%+=1 0ș"Hourglass_Percentage",total2%/total1%*100 ts$=�fulls(�(tsize(k)),7) tl$=�fulls(�(tlen(k)),7) "tc$=�fulls(�(tcount(k)),7) ,$rootl$=�fulls(�(�(troot$(k))),3) 6 endt=tblk @$endt=ts$+tl$+tc$+rootl$ Jendt+=24 Tș"OS_GBPB",2,fh%,tblk,24 ^ endt=tblk h$endt=troot$(k) rendt+=�(troot$(k)) |'ș"OS_GBPB",2,fh%,tblk,�(troot$(k)) �&ș"OS_GBPB",2,fh%,tree(k),tsize(k) �� k �ș&0D,0,fh% �ș"OS_File",18,save$,&00D �9� save$<>"<Wimp$Scrap>" � � �checkflag(saved%,3,21) � �!block=main% �!ș"Wimp_GetWindowInfo",,block �saved=� �X$(block!76)=save$:ș"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 ��info(saved%,1,save$) ��info(finfo%,3,"No") �� �ș"Hourglass_Smash" A� quiting șreinter,mytask%:ș"Wimp_CloseDown",task,mytask%:� � � winsave%=save% � &ș"Hourglass_On" 0ș"OS_Find",&80,save$ � fh% :;� �checkflag(save%,3,21) � stt=st:ett=st:� stt=0:ett=ct Dtotal1%=0:total2%=0 N(� I=stt � ett:total1%+=tcount(I):� I X� I=stt � ett btotal2%+=1 l0ș"Hourglass_Percentage",total2%/total1%*100 v endt=tblk �*$endt=" "+troot$(I)+�10+�10 �'endt+=�(" "+troot$(I))+2 �$ș"OS_GBPB",2,fh%,tblk,endt-tblk �d� �checkflag(save%,4,21) � s1>-1 � stt=tt:ett=tt:stptr=s1:endptr=s2:� stptr=0:endptr=tcount(I)-1 � � J=stptr � endptr � n=J*24 � t$="" � � h=0 � 2 � i=n+h � t$+=�(tree(I)?i) � � h � endt=tblk � � h=1 � �(t$) $endt=" " endt+=1 � h t$="" * � h=3 � 12 4 i=n+h >' � tree(I)?i<>0 � t$+=�(tree(I)?i) H � h R $endt=t$+�10 \ endt+=�(t$)+1 f% ș"OS_GBPB",2,fh%,tblk,endt-tblk p � J z endt=tblk �$endt=�10+�10 �endt+=2 �$ș"OS_GBPB",2,fh%,tblk,endt-tblk �� I �ș&0D,0,fh% �ș"OS_File",18,save$,&FFF �Ȏ save$ � �� "<Wimp$Scrap>" � �!block=main% �!ș"Wimp_GetWindowInfo",,block �saved=� �X$(block!76)=save$:ș"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 �info(finfo%,3,"No") � ș"Hourglass_Smash" $A� quiting șreinter,mytask%:ș"Wimp_CloseDown",task,mytask%:� .� 8� � B� L Vݤgetbs(fh%,len) `string$="" j� I=1 � len tș"OS_BGet",,fh% � byte ~string$+=�(byte) �� �=string$ � ���messagein �sendm=&400E7 �ref=block!8:task=block!4 �Ȏ block!16 � �� 0:�end �� 2: �save$=�wool(block+44) ��dragspr(1) �%� winsave%=new% � �dragnew(save$) !� drive%=1 � winsave%<>new% � �save(save$) mblock!0=256 mblock!12=ref (mblock!16=3 2mblock!36=-1 <$(mblock+44)=save$ F'ș &400E7,18,mblock,task:� DataLoad P� Z� 3: d� block!40=&00d � n&load$=�wool(block+44):�load(load$) x� �� �� block!40<>&00D � �)load$=�wool(block+44):�newtree(load$) �� �� 5: �� block!40=&00D � �block!12=block!8:block!16=4 �+ș sendm,18,block,block!4:� DataLoadAck ��load(�wool(block+44)) �� �G� 8:� � prequit block!12=ref:șsendm,19,block:prequit=�:�areyousure �� �� ��load(load$) in=� "#� ct=-1 � �info(finfo%,0,load$) ,!ș"OS_Find",&40,load$ � load% 6"Len=�("DiskTree Data File v�") @title$=�getbs(load%,Len) Jh� title$<>"DiskTree Data File v�" � �query("This is not a true DiskTree Data file!"):ș&0D,0,load%:� T� � ^s� � � � �=388 �query("Out Of Memory "+Þ):ș&0D,0,load%:� �:�:� � �:�error(�$+" : at line "+Þ):ș&0D,0,load%:� hnof=�(�getbs(load%,3)) r� m=0 � nof |TLen=�(�getbs(load%,7)) �TLen%=�(TLen/8)*8 �)ș"OS_Heap",1,heap% � ,,largest,tfree �� TLen%+1024>largest � �%ș"Wimp_SlotSize",-1,-1 � current �5ș"Wimp_SlotSize",current+(TLen%-largest)+1024,-1 �!ș"Wimp_SlotSize",-1,-1 � new �change=new-current �ș"OS_Heap",5,heap%,,change �hsizeb+=change �� � ct+=1 �tsize(ct)=TLen �tlen(ct)=�(�getbs(load%,7)) !tcount(ct)=�(�getbs(load%,7)) rootl=�(�getbs(load%,3)) "troot$(ct)=�getbs(load%,rootl) &*ș"OS_Heap",2,heap%,,TLen � ,,tree(ct) 0"ș"OS_Heap",1,heap% � ,,,tfree :%ș"OS_GBPB",4,load%,tree(ct),TLen D� m Nș&0D,0,load% X!icond=main% b!ș"Wimp_GetWindowInfo",,icond lYsaved=�:$icond!76=load$:ș"Wimp_ForceRedraw",-1,icond!4,icond!16,icond!12,icond!16+36 vș"Wimp_CloseWindow",,icond �$�info(saved%,1)=load$ � st=ct �"�newview:�openwin(main%):�pane ��info(finfo%,1,�(ct+1)) �#�info(finfo%,2,�(hsizeb-tfree)) �arclisted=� �� � �� � ���openwin(handle%) �G� handle%=main% � ct=-1 � �query("No directory trees in memory!"):� �!block=handle% �!ș"Wimp_GetWindowInfo",,block open=block!32 � (1<<16) front=block!32 � (1<<17) W� handle%=main% � width>-1 � block!12=block!4+width:block!8=block!16-depth:width=-1 � open=0 � *ș"Wimp_OpenWindow",,block 4� >� front=0 � H*block!28=-1:ș"Wimp_OpenWindow",,block R� \� f p� �slabin(handle) z!icond=handle �#ș "Wimp_GetPointerInfo",,icond �ș "Wimp_BorderIcon",,icond �� � �� �slabout(handle) �!icond=handle �#ș "Wimp_GetPointerInfo",,icond � icond!8=0 �ș "Wimp_BorderIcon",,icond �� � ���redraw(handle) �setex=� !block=handle �more% )ș "Wimp_RedrawWindow",,block � more% $ȕ more% . Ȏ handle � 8 � main% B �application_redraw L V! ș"Wimp_BorderWindow",,block ` � j* ș "Wimp_GetRectangle",,block � more% t � ~� � ���application_redraw �workx%=block!4-block!20 �worky%=block!16-block!24 �max=block!32-worky% �min=block!40-worky% �max=(max+46)�36*-1 �min=(min+46)�36*-1 �)� max>tcount(st)-1 � max=tcount(st)-1 �� ct=-1 � � �#tx=workx%:ty=worky%-46-(min*36) �g=&400E6 n=min*24 � I=min � max șg,7 t$="" ( � h=0 � 2 2 i=n+h < t$+=�(tree(st)?i) F � h P len=�(t$)-1 Z � len=-1 � len=0 d t$="" n � h=3 � 12 x i=n+h � t$+=�(tree(st)?i) � � h �O � itemno=I � șg,9:ȓ Ȑ workx%+0,worky%-0-(I*36+46),tlen(st)*16,-30:șg,7 �V � I>=s1 � I<=s2-1 � șg,7:ȓ Ȑ workx%+0,worky%-0-(I*36+46),tlen(st)*16,-34:șg,0 �K � I=s2 � șg,7:ȓ Ȑ workx%+0,worky%-0-(I*36+46),tlen(st)*16,-30:șg,0 �! � tree(st)?(i+1)=138 � șg,8 � � tx,ty � � �len)t$ � ty-=36 � n+=24 �� I �tyy=worky%-ty-40 �� ��pane � ct=-1 � � "9bar1=block!4:bar2=block!8:bar3=block!12:bar4=block!16 ,bar5=block!52:bar6=block!20 6� toolson � �all:� �baronly @/!block=found%:ș"Wimp_GetWindowInfo",,block Jopen=block!32 � (1<<16) T� open � �openwin(found%) ^� h r ��baronly |front=block!28 �-!icond=bar%:ș"Wimp_GetWindowInfo",,icond �9icond!4=bar1:icond!8=bar2:icond!12=bar3:icond!16=bar4 �icond!20=bar6 �-icond!28=front:ș"Wimp_OpenWindow",,icond �,block!28=bar%:ș"Wimp_OpenWindow",,block �� � � ��all �front=block!28 �2x1=block!4-94:x2=x1+248:y1=block!8:y2=block!16 �size=x2-x1 �1!icond=toolbox%:ș"Wimp_GetWindowInfo",,icond �� x1<0 � x1=0:x2=size 5icond!4=x1:icond!8=y2-570:icond!12=x2:icond!16=y2 -icond!28=front:ș"Wimp_OpenWindow",,icond � &-!icond=bar%:ș"Wimp_GetWindowInfo",,icond 09icond!4=bar1:icond!8=bar2:icond!12=bar3:icond!16=bar4 :icond!20=bar6 D0icond!28=toolbox%:ș"Wimp_OpenWindow",,icond N,block!28=bar%:ș"Wimp_OpenWindow",,block X� b l ��adjustwin(newxmax,newymin) v-!icond=bar%:ș"Wimp_GetWindowInfo",,icond �icond!52=newxmax �$ș"Wimp_SetExtent",bar%,icond+44 �.!icond=main%:ș"Wimp_GetWindowInfo",,icond �%icond!48=newymin:icond!52=newxmax �%ș"Wimp_SetExtent",main%,icond+44 �6!icond=bar%:icond!4=0:ș"Wimp_GetIconState",,icond �ș"Wimp_DeleteIcon",,icond �0icond=icond+4:icond!12=newxmax+2:!icond=bar% �%ș"Wimp_CreateIcon",0,icond � ic% �� � ���toolbox(flag) �;� flag=-1 � !block=toolbox%:ș"Wimp_CloseWindow",,block !� flag=1 � !!block=main% !"ș"Wimp_GetWindowState",,block ! open=block!32 � (1<<16) !*"� open<>0 � !icond=main%:�pane !4� !>� !H !R��error(err$) !\M!icond=0:$(icond+4)=err$+"."+" Press OK to continue or Cancel to quit"+�0 !f3ș"Wimp_ReportError",icond,3,"!DiskTree" � ,but !pA� but=2 � șreinter,mytask%:ș"Wimp_CloseDown",task,mytask%:� !z� !� !���areyousure !� � saved � !��openwin(quit%) !�� 7 !�1�info(quit%,1,"Your file has been modified.") !�M!block=130:block!4=131:block!8=-1:ș"OS_ReadVduVariables",block,block+128 !�%ș"OS_ReadModeVariable",�,4 � ,,x !�%ș"OS_ReadModeVariable",�,5 � ,,y !�9ȗ ȓ 0,0,(((block!128)+1)*2^x)-1,((block!132)+1)*2^y !�� !�A� � saved șreinter,mytask%:ș"Wimp_CloseDown",task,mytask%:� !�� " "��query(qu$) "�openwin(query%) "$� 7 ".!block=query% "8!ș"Wimp_GetWindowInfo",,block "Bworkx%=block!12-block!4 "Lworky%=block!16-block!8 "V'ȗ ȓ block!4,block!8,workx%,worky% "`�info(query%,1,qu$) "j� "t "~ ��endq "��close(query%) "�M!block=130:block!4=131:block!8=-1:ș"OS_ReadVduVariables",block,block+128 "�%ș"OS_ReadModeVariable",�,4 � ,,x "�%ș"OS_ReadModeVariable",�,5 � ,,y "�9ȗ ȓ 0,0,(((block!128)+1)*2^x)-1,((block!132)+1)*2^y "�� "� "���close(!block) "�ș"Wimp_CloseWindow",,block "�� "� "���dragspr(flag) # � dragspr � # Ȏ flag � #� 1: #;!block=winsave%:block!4=2:ș "Wimp_GetIconState",,block #(,block!8=0:block!12=0:$(block!32)=dindir$ #2!ș "Wimp_SetIconState",,block #<ș "DragASprite_Stop" #F � -1: #P;!block=winsave%:block!4=2:ș "Wimp_GetIconState",,block #Zdindir$=$(block!32) #d(block!8=0:block!12=0:$(block!32)=�13 #n!ș "Wimp_SetIconState",,block #x� #�� #�� #� #���newtree(file$) #�%� block!40=4096 � block!40=8192 � #�path$=file$+"." #��info(new%,1,path$) #��openwin(new%) #�� #�� #�path$=�getleaf(file$) #�#path$=�file$,�(file$)-�(path$)) #��info(new%,1,path$) $� $ $��dragnew(path$) $"+block!40=4096:path$=�path$,�(path$)-10) $,�newtree(path$) $6� $@ $J��drive0 $T=ș"OS_FSControl",37,"ADFS::0.$",tblk,0,0,1024 � ,,,,,tlen $^'�info(new%,1,�$tblk,1024-tlen)+".") $h� $r $|��go $�L� ct=maxno � �mess("There is no me free trees available in this file"):� $�#arcx=0:prearcx=-1:arcs=�:apps=� $� arcs=� �checkflag(new%,0,21) $� apps=� �checkflag(new%,3,21) $�root$=$�info(new%,1) $�D� root$="" � �mess("You have not entered a path to catalogue"):� $�root$=�root$,�(root$)-1) $�ș"OS_File",20,root$ � type $�C� type<>2 � �mess("The path to catalogue has not been found"):� $� Ȏ arcs � $�� �: $�$tblk="ArcFS" $�ș"XOS_Module",18,tblk � r0 %� r0<>18 � %�� �ask("ArcFS not present. Only able to create trees of archives if ArcFS is present. Continue without archives?")=1 � arcs=�:� �close(new%):� %� %&� %0 ș"XOS_File",13,root$ � type %:`� type<2 � type>3 � �query("Path to create tree from is not a directory/does not exist."):� %Dendlisty=0:nlen=0:stop=� %NbotLED=%10:totsize=0 %Xcount=0 %b ct+=1 %lș"Hourglass_On" %v(ș"OS_Heap",1,heap% � ,,membuf,tfree %�membuf=membuf-1024 %�� membuf<1024 � %�%ș"Wimp_SlotSize",-1,-1 � current %�)ș"Wimp_SlotSize",current+(8*1024),-1 %�!ș"Wimp_SlotSize",-1,-1 � new %�change=new-current %�ș"OS_Heap",5,heap%,,change %�hsizeb+=change %�membuf+=change %�� %�,ș"OS_Heap",2,heap%,,membuf � ,,tree(ct) %�object=0 %�endtext%=tree(ct) &dir$="" &x=0 &lastdir(0)=0 & start=� &*� &4object=lastdir(x) &>�gotree &H� stop � � &R� endlisty=1 � � &\� &fdir$=�dir$,(�dir$)-1) &p� �dir$,�dir$)="." &zdir$=�dir$,(�dir$)-1) &�� � &�� &� &���gotree &�� &�Aș"OS_GBPB",10,root$+dir$,buffer,1,object,63 � ,,,reader,last &�� last<>-1 � &�file$="" &�buff=20 &�� &�file$+=�buffer?buff &�buff+=1 &��buffer?buff=0 ')� �file$,1)=�0 file$=�file$,�file$-1) 'length=buffer!8 'type=buffer!16 '$<ș"OS_File",20,root$+dir$+"."+file$ � type,,,,,,filetype '.=� filetype=4096 � filetype=8192 � length=-1 � length=2048 '8� type=2 ext$="�" � ext$=�0 'B9� filetype=4096 � type=3 � filet$="DDC":filetype=&DDC 'L#� arcs � filetype=&DDC ext$="�" 'V nlent=�(dir$+file$)-x+1+arcx '`� nlent>nlen � nlen=nlent 'jpredicted=endtext%-tree(ct) 't"� predicted>membuf-1024 � �mem '~� stop � � '�fi$=�fulls(file$,10) '�%di$=�fulls(�((�dir$)-x+arcx+1),3) '�leng$=�fulls(�length,7) '�filet$=�~filetype '�"� filetype=4096 � filet$="DIR" '�"� filetype=8192 � filet$="APP" '�5� �(filet$)<3 � �:filet$="0"+filet$:� �(filet$)=3 '�'$endtext%=di$+fi$+ext$+leng$+filet$ '�endtext%+=24 '�totsize+=length '� object+=1 '�count+=1 ( *� botLED=%01 � botLED=%10 � botLED=%01 ( !ș"Hourglass_LEDs",%11,botLED (� arcs � filetype=&DDC � (Xprearcroot$=root$:prearcdir$=dir$:prearclast=object:lastdir(x)=object:prearcx=x:x+=1 ((*�("OpenArchive "+root$+dir$+"."+file$) (2Rroot$="ArcFS#"+file$+":$":arcname$=file$:object=0:arcx=�(dir$+file$)+1:dir$="" (<1arcct+=1:arc$(arcct)=file$+","+�count+","+�ct (F� (PG� filetype=4096 dir$=dir$+"."+file$:lastdir(x)=object:x+=1:object=0 (ZN� filetype=8192 � apps dir$=dir$+"."+file$:lastdir(x)=object:x+=1:object=0 (d� (n� reader=0 (xx-=1 (�"� x=-1 � prearcx=-1 �endoflist (��� x=prearcx � prearcx>-1 � x=prearcx:root$=prearcroot$:dir$=prearcdir$:object=prearclast:lastdir(x)=object:prearcx=-1:arcx=0:�("CloseArchive "+arcname$):�gotree (�� endlisty=1 � � (�� (� (���endoflist (�finish=�-start (�+$endtext%=�17+�totsize+�18+�finish+�255 (�#endtext%+=�(�totsize+�finish)+3 (�tsize(ct)=endtext%-tree(ct) (�9tcount(ct)=count:tlen(ct)=nlen:st=ct:troot$(ct)=root$ (�*ș"OS_Heap",6,heap%,tree(ct) � ,,,curb (�@ș"OS_Heap",4,heap%,tree(ct),(tsize(ct)-curb)+8 � ,,tree(ct) )ș"Hourglass_Smash" )endlisty=1 )+!block=new%:ș"Wimp_CloseWindow",,block )"-!block=tinfo%:ș"Wimp_CloseWindow",,block ),-!block=finfo%:ș"Wimp_CloseWindow",,block )6-!block=iinfo%:ș"Wimp_CloseWindow",,block )@�info(finfo%,1,�(ct+1)) )J#�info(finfo%,2,�(hsizeb-tfree)) )T<� $�info(finfo%,0)="None" � �info(finfo%,0,"<Untitled>") )^� saved=� � )hsaved=� )r!icond=main% )|!ș"Wimp_GetWindowInfo",,icond )� $(icond!76)=$(icond!76)+" *" )�Fș"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 )��info(finfo%,3,"Yes") )�� )�,!block=main%:ș"Wimp_CloseWindow",,block )�"�newview:�openwin(main%):�pane )�� )� )� ��mem )�)ș"OS_Heap",6,heap%,tree(ct) � ,,,ohs )� ș"OS_ReadMemMapInfo" � page )�%ș"Wimp_SlotSize",-1,-1 � current )�%ș"Wimp_SlotSize",current+page,-1 *!ș"Wimp_SlotSize",-1,-1 � new *change=new-current *�� change=0 � �query("Out Of Memory. Free more memory and try again."):ct-=1:ș&1D,3,heap%,tree(ct):stop=�:ș"Hourglass_Smash":� *&ș"OS_Heap",5,heap%,,change *04ș"OS_Heap",4,heap%,tree(ct),change � ,,tree(ct) *:)ș"OS_Heap",6,heap%,tree(ct) � ,,,nhs *Dhsizeb+=change *Nmembuf+=nhs-ohs *X� *b *l��makearclist *v � j=0 � maxno: arc$(j)="": � *� aind=0 *�� j=0 � ct *� � count=0 � tcount(j) *� index=count*24 *� type$="" *� � h=21 � 23 *�! type$+=�(tree(j)?(index+h)) *� � *� � type$="DDC" � *� t$="" *� � h=3 � 12 *� val=tree(j)?(index+h) *� � val<>0 � t$+=�val + � +B � aind<maxno � arc$(aind)=t$+","+�(count+1)+","+�(j):aind+=1 + � + � count +*� j +4arcct=aind-1 +>� +H +R ��last +\� st=0 � � +f st-=1 +p,!block=main%:ș"Wimp_CloseWindow",,block +z�newview +��openwin(main%) +��close(find%) +��close(iinfo%) +��close(tinfo%) +��close(notfnd%) +��close(found%) +� �pane +�� +� +� ��next +�� st=ct � � +� st+=1 +�,!block=main%:ș"Wimp_CloseWindow",,block ,�newview ,�openwin(main%) ,�close(find%) ,$�close(iinfo%) ,.�close(tinfo%) ,8�close(notfnd%) ,B�close(found%) ,L �pane ,V� ,` ,j ��newview ,t� ct=-1 � � ,~�info(bar%,0,troot$(st)) ,�tptr=tcount(st)*24+1 ,� sizeb$="" ,�� ,�"sizeb$=sizeb$+�(tree(st)?tptr) ,�tptr+=1 ,�� tree(st)?tptr=18 ,�tptr+=1 ,�finishs$="" ,�� ,�&finishs$=finishs$+�(tree(st)?tptr) ,�tptr+=1 ,�� tree(st)?tptr=255 - �info(tinfo%,0,troot$(st)) - �info(tinfo%,1,�tcount(st)) -�info(tinfo%,2,�tsize(st)) -�info(tinfo%,3,sizeb$) -(�info(tinfo%,7,finishs$) -2.xalt=tlen(st)*16:yalt=0-(tcount(st)*36+40) -<�adjustwin(xalt,yalt) -F itemno=-1 -P$�seticstate(find%,4,1<<22,1<<22) -Z depth=568 -d5� tcount(st)*36+40<depth � depth=tcount(st)*36+40 -nwidth=tlen(st)*16 -x� width>500 � width=500 -�� -� -���selectitem -�olditemno=itemno -�ycoord=block!4 -�.!block=main%:ș"Wimp_GetWindowInfo",,block -�workx%=block!4-block!20 -�worky%=block!16-block!24 -�ycoord=0-(block!16-ycoord) -�ycoord=ycoord+block!24 -�!itemno=�((ycoord-40)/36)*-1-3 -� itemst=st -�� olditemno=itemno � � .ycoord=0-(itemno*36+44) .=ș"Wimp_ForceRedraw",main%,1,ycoord-32,tlen(st)*16,ycoord .ycoord=0-(olditemno*36+44) ."=ș"Wimp_ForceRedraw",main%,1,ycoord-32,tlen(st)*16,ycoord .,�putinfo(itemno) .6$�seticstate(find%,4,1<<22,0<<22) .@� .J .T��putinfo(itemno) .^n=itemno*24 .h t$="" .r*� h=3 � 12:i=n+h:t$+=�(tree(st)?i):� h .|'�info(iinfo%,0,troot$(st)+"..."+t$) .� t$="" .�+� h=14 � 20:i=n+h:t$+=�(tree(st)?i):� h .��info(iinfo%,4,t$) .� t$="" .�+� h=21 � 23:i=n+h:t$+=�(tree(st)?i):� h .�te$="&"+t$+" ("+t$+")" .�tblk=tt .�5ș"XOS_FSControl",18,,�hextodec(t$) � r0,,r2%,r3% .� � r0=18 � .�/tblk!0=r2%:tblk!4=r3%:tblk?8=13:type$=$tblk .�te$=type$+" ("+t$+")" .�� .�st$="sfile_"+t$ /0� t$="APP" � te$="Application ":st$="sapp" /0� t$="DIR" � te$="Directory ":st$="sdir" /!�indir(iinfo%,1,"","b0;"+st$) /&�info(iinfo%,3,te$) /0� /: /D��selection /N olds1=s1:olds2=s2:olditem=ss /Xycoord=block!4 /b.!block=main%:ș"Wimp_GetWindowInfo",,block /lworkx%=block!4-block!20 /vworky%=block!16-block!24 /�ycoord=0-(block!16-ycoord) /�ycoord=ycoord+block!24 /�ss=�((ycoord-40)/36)*-1-3 /�E�seticstate(save%,4,1<<22,1<<22):�seticstate(save%,4,1<<21,0<<21) /�� olditem=ss � /�s1=-1:s2=-1 /�ycoord=0-(olds1*36+44) /�Eș"Wimp_ForceRedraw",main%,1,ycoord-(olds2*36),tlen(st)*16,ycoord /�� /�� /�gap=s2-s1:gap=gap/2 /�� s1=-1 � s1=ss /�� ss>s1+gap � s2=ss 0� ss<s1 � s1=ss 0� ss<s1+gap � s1=ss 0� ss=s1+gap � s2=ss 0 '� s1>s2 � s2>-1 � sc=s2:s1=s2:s2=sc 0*6� s1>-1 � s2>-1 � �seticstate(save%,4,1<<22,0<<22) 04ycoord=0-(olds1*36+44) 0>Eș"Wimp_ForceRedraw",main%,1,ycoord-(olds2*36),tlen(st)*16,ycoord 0Hycoord=0-(s1*36+44) 0RBș"Wimp_ForceRedraw",main%,1,ycoord-(s2*36),tlen(st)*16,ycoord 0\� 0f 0p%��indir(handle,icon,text$,indir$) 0z;!block=handle:block!4=icon:ș"Wimp_GetIconState",,block 0�=$(block!28)=text$:$(block!32)=indir$:block!36=�(indir$)+1 0�block!8=0:block!12=0 0� ș"Wimp_SetIconState",,block 0�� 0� 0���scroll 0�(pagesize=�((block!16-block!8-40)/36) 0�5� block!32=1 � block!20=block!20+(tlen(st)*16)/10 0�6� block!32=-1 � block!20=block!20-(tlen(st)*16)/10 0�<� block!36=1 � topno=�(block!24/36):block!24=topno*36+36 0�� block!36=-1 � ycoord=0-(block!16-block!8)+block!24:botno=�((ycoord-40)/36)*-1-3:botno=botno*36+36+40:block!24-=ycoord+botno 0�4� block!32=2 � block!20=block!20+(tlen(st)*16)/5 0�5� block!32=-2 � block!20=block!20-(tlen(st)*16)/5 1I� block!36=2 � topno=�(block!24/36)*-1:block!24=0-(topno-pagesize)*36 1�� block!36=-2 � ycoord=(0-(block!16-block!8))+block!24:botno=�((ycoord-40)/36)*-1-3:botno=(botno+pagesize-1)*36+36+40:block!24-=ycoord+botno 1ș"Wimp_OpenWindow",,block 1$� 1. 18��delete(no) 1Bdone=-1 1L � no=ct � 1V ș"OS_Heap",3,heap%,tree(ct) 1`)ș"OS_Heap",1,heap% � ,,largest,tfree 1j)ș"OS_Heap",5,heap%,,0-(largest-1024) 1t hsizeb=hsizeb-(largest-1024) 1~ ct-=1 1� done=1 1�� 1�� no<>ct � done=-1 � 1�� j=no � ct 1�ș"OS_Heap",3,heap%,tree(j) 1�� 1�� j=no � ct-1 1�/ș"OS_Heap",2,heap%,,tsize(j+1) � ,,tree(j) 1� � I=0 � tsize(j+1) � 4 1� tree(j)!I=tree(j+1)!I 1� � I 1�-tsize(j)=tsize(j+1):tcount(j)=tcount(j+1) 2 +tlen(j)=tlen(j+1):troot$(j)=troot$(j+1) 2 � j 2 ct-=1 2)ș"OS_Heap",1,heap% � ,,largest,tfree 2()ș"OS_Heap",5,heap%,,0-(largest-1024) 22 hsizeb=hsizeb-(largest-1024) 2<� 2F ș"OS_ReadMemMapInfo" � page 2P%ș"Wimp_SlotSize",-1,-1 � current 2Z� largest>page � 2d&amount=�((largest-1024)/page)*page 2n>� current-amount<=origappsize � amount=current-origappsize 2x'ș"Wimp_SlotSize",current-amount,-1 2�� 2�� ct=-1 � �clearall:� 2�� st>=no � st-=1 2�� st=-1 � st=0 2��info(finfo%,1,�(ct+1)) 2�#�info(finfo%,2,�(hsizeb-tfree)) 2�� saved=� � 2��info(finfo%,3,"Yes") 2�saved=� 2�!icond=main% 2�!ș"Wimp_GetWindowInfo",,icond 2� $(icond!76)=$(icond!76)+" *" 2�Fș"Wimp_ForceRedraw",-1,block!4,(block!16)-32,block!12,block!16+36 3� 3,!block=main%:ș"Wimp_CloseWindow",,block 3arclisted=� 3""�newview:�openwin(main%):�pane 3,� 36 3@��clearall 3J � ct>-1 � 3T� I=0 � ct 3^ș"OS_Heap",3,heap%,tree(I) 3h� 3r)ș"OS_Heap",1,heap% � ,,largest,tfree 3|)ș"OS_Heap",5,heap%,,0-(largest-1024) 3�ș"Wimp_SlotSize",orig,-1 3�� 3�)ș"OS_Heap",1,heap% � ,,largest,tfree 3�hsizeb=largest 3� ct=-1 3�.!block=main%:ș"Wimp_GetWindowInfo",,block 3�$(block!76)="<Untitled>" 3�ș"Wimp_CloseWindow",,block 3��info(finfo%,0,"None") 3��info(finfo%,1,"0") 3��info(finfo%,2,"0") 3��info(finfo%,3,"No") 3�saved=� 4+!block=new%:ș"Wimp_CloseWindow",,block 4-!block=tinfo%:ș"Wimp_CloseWindow",,block 4-!block=finfo%:ș"Wimp_CloseWindow",,block 4&-!block=iinfo%:ș"Wimp_CloseWindow",,block 40+!block=bar%:ș"Wimp_CloseWindow",,block 4:/!block=toolbox%:ș"Wimp_CloseWindow",,block 4Dst=0 4Narclisted=� 4X� 4b 4l��opentree(no) 4v st=no 4��newview 4�,!block=main%:ș"Wimp_CloseWindow",,block 4��openwin(main%):�pane 4�� 4� 4���openarc(no) 4�use$=arc$(no) 4�str$=�use$,�use$,",")) 4�#numb$=�use$,�(use$)-�use$,",")) 4�oct$=�numb$,�numb$,",")-1) 4�x$=�numb$,�numb$-�oct$-1) 4�origt=st 4�st=�(x$) 5�goto(�(oct$)-1) 5� 5 5 ��goto(ino) 5*�info(bar%,0,troot$(st)) 54tptr=tcount(st)*24+1 5> sizeb$="" 5H� 5R$ sizeb$=sizeb$+�(tree(st)?tptr) 5\ tptr+=1 5f� tree(st)?tptr=18 5ptptr+=1 5zfinishs$="" 5�� 5�( finishs$=finishs$+�(tree(st)?tptr) 5� tptr+=1 5�� tree(st)?tptr=255 5��info(tinfo%,0,troot$(st)) 5��info(tinfo%,1,�tcount(st)) 5��info(tinfo%,2,�tsize(st)) 5��info(tinfo%,3,sizeb$) 5��info(tinfo%,7,finishs$) 5�(� uptot>-1 � uptot<>origt � �newview 5�,!block=main%:ș"Wimp_CloseWindow",,block 5��openwin(main%):�pane 5�.!block=main%:ș"Wimp_GetWindowInfo",,block 6workx%=block!4-block!20 6worky%=block!16-block!24 6ycoord=0-(itemno*36+44) 6$itemno=ino 6.!block!24=0-((itemno-2)*36+44) 68ș"Wimp_OpenWindow",,block 6B=ș"Wimp_ForceRedraw",main%,1,ycoord-32,tlen(st)*16,ycoord 6L� 6V 6` ��find 6j�close(find%) 6t�close(found%) 6~$� �checkflag(find%,1,21) � opt=1 6�$� �checkflag(find%,6,21) � opt=2 6�$� �checkflag(find%,9,21) � opt=3 6� from=0 6�J� �checkflag(find%,17,21) � sttree=st:endtree=st � sttree=0:endtree=ct 6�B� �checkflag(find%,4,21) � from>-1 � from=itemno:sttree=itemst 6�origt=st 6�� � found � 6�nonefnd=-1 6�totalcnt=0 6�� n=sttree � endtree 6�totalcnt=+tcount(n) 6�� n 7 nowon=0 7 � 7Ȏ opt � 7� 1: 7(search$=$�info(find%,2) 72 tex$=search$:tex2$="Name :-" 7<search$=�fulls(search$,10) 7Fcase=�checkflag(find%,3,21) 7P%� � case � search$=�caps(search$) 7Z4� found � �checkflag(find%,18,21) � sttree=uptot 7d� ontree=sttree � endtree 7n!� found � from=upto+1:found=� 7x st=ontree 7� n=from*24 7�ș"Hourglass_On" 7�� I=from � tcount(st) 7� nowon+=1 7� t$="" 7� � h=3 � 12 7� i=n+h 7� t$+=�(tree(st)?i) 7� � h 7� � � case � t$=�caps(t$) 7�] � t$=search$ � ș"Hourglass_Smash":nonefnd=1:upto=I:uptot=ontree:�goto(I):�found(I,st):� 7� n+=24 7�0 ș"Hourglass_Percentage",nowon/totalcnt*100 8� I 8from=0:upto=0 8� ontree 8"ș"Hourglass_Smash" 8,� 86� 2: 8@Search$=$�info(find%,7) 8J� �Search$,1)="&" � 8Tsearch$=Search$ 8^"search$=�search$,�(search$)-1) 8h&� �search$>3 � search$=�search$,3) 8r,� �search$<3 � search$=�longs(search$,3) 8|$tex$="&"+search$:tex2$="Type :-" 8�� 8�� �Search$,1)<>"&" � 8�search$=Search$ 8�/ș"XOS_FSControl",31,search$ � r0,,filetype 8�Q� r0<>31 � �mess("File type not recognised; Try entering file type number"):� 8�search$=�~filetype 8�,� �search$<3 � search$=�longs(search$,3) 8�$tex$="&"+search$:tex2$="Type :-" 8�� 8�4� found � �checkflag(find%,18,21) � sttree=uptot 8� � ontree=sttree � endtree 8�" � found � from=upto+1:found=� 8� st=ontree 9 n=from*24 9 ș"Hourglass_On" 9 � I=from � tcount(st) 9& nowon+=1 90 t$="" 9: � h=21 � 23 9D i=n+h 9N t$+=�(tree(st)?i) 9X � h 9b^ � t$=search$ � ș"Hourglass_Smash":nonefnd=1:upto=I:uptot=ontree:�goto(I):�found(I,st):� 9l n+=24 9v1 ș"Hourglass_Percentage",nowon/totalcnt*100 9� � I 9�from=0:upto=0 9�� ontree 9�ș"Hourglass_Smash" 9�� 9�� 3: 9�search$=$�info(find%,11) 9�search2$=$�info(find%,12) 9�search=�(search$)*1000 9�search2=�(search2$)*1000 9�.tex$=�((search+search2)/2):tex2$="Size :-" 9�search$=�fulls(search$,10) 9�4� found � �checkflag(find%,18,21) � sttree=uptot :� ontree=sttree � endtree :!� found � from=upto+1:found=� : st=ontree : n=from*24 :*ș"Hourglass_On" :4� I=from � tcount(st) :> nowon+=1 :H t$="" :R � h=14 � 20 :\ i=n+h :f t$+=�(tree(st)?i) :p � h :z t=�(t$) :�g � t>search � t<search2 � ș"Hourglass_Smash":nonefnd=1:upto=I:uptot=ontree:�goto(I):�found(I,st):� :� n+=24 :�0 ș"Hourglass_Percentage",nowon/totalcnt*100 :�� I :�from=0:upto=0 :�� ontree :�ș"Hourglass_Smash" :�� :�� :�st=origt :��info(notfnd%,1,tex$) :��info(notfnd%,2,tex2$) :��openwin(notfnd%) ;found=� ;� ; ;$��found(item,trno) ;. n=item*24 ;8 t$="" ;B*� h=3 � 12:i=n+h:t$+=�(tree(st)?i):� h ;L�info(found%,3,t$) ;V t$="" ;`4� h=14 � 20:i=n+h:t$+=�(tree(st)?i):� h:size$=t$ ;j t$="" ;t+� h=21 � 23:i=n+h:t$+=�(tree(st)?i):� h ;~te$="&"+t$+" ("+t$+")" ;�tblk=tt ;�6ș"XOS_ReadVarVal","File$Type_"+t$,tblk,512 � ,,br ;� � br<>0 � ;�type$="" ;�� s=0 � br-1 ;�type$+=�tblk?s ;�� s ;�� �(type$)<8 � ;�� ;�type$=type$+" " ;�� �(type$)=8 ;�� <