Home » Personal collection » Acorn hard disk » apps » MultiStore » !MultiStor/MSFastSort
!MultiStor/MSFastSort
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 » Personal collection » Acorn hard disk » apps » MultiStore |
Filename: | !MultiStor/MSFastSort |
Read OK: | ✔ |
File size: | D3EA bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM> <MultiStore$Dir>.MSFastSort 20REM By Merlyn Kline for Copyright (c) Minerva Software, 1989 30: version$="2.02" 40 50ONERROR:PROCerror(ERR,REPORT$,ERL,TRUE) 60PROCinit 70ONERROR:PROCerror(ERR,REPORT$,ERL,process%<4ANDprocess%>0):PROCreport 80PROCnormpoint 90 100REPEAT 110IFprocess%>0:PROCprocess 120SYS"Wimp_PollIdle",,q%,delay%TOreason% 130IFtaskhandle%>0:SYSswi%,selecttask_%,taskhandle% 140PROCrespond(reason%) 150UNTILquit% 160PROCCLOSE:PROCquit(FALSE) 170END 180 190DEFPROCrespond(reason%) 200IFreason%:PROCwaitpoint 210CASEreason%OF 220WHEN 0:PROCbackgrnd 230WHEN 1:PROCredraw(FALSE) 240WHEN 2:PROCopen(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,q%!28) 250WHEN 3:PROCclosew(!q%) 260WHEN 4:PROCptrexit(!q%) 270WHEN 5:PROCptrenter(!q%) 280WHEN 6:PROCmouse(!q%,q%!4,q%!8,q%!12,q%!16,q%!20) 290WHEN 7:PROCenddrag 300WHEN 8:PROCkey(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24) 310WHEN 9:PROCmenuselect 320WHEN17,18:PROCumess1 330WHEN19:PROCumess2 340ENDCASE 350PROCnormpoint 360ENDPROC 370 380DEFPROCquit(T%):PROCnormpoint:PROCnovars 390$q%="TASK":SYS"Wimp_CloseDown",taskhandle%,!q% 400IFT%ORFNdebug:PROCtidy:END 410SYSswi%,killtask_%,taskhandle% 420QUIT 430 440DEFFNtask=otask% 450 460DEFPROCinit:otask%=Z%:PROCswinums 470appl$="MultiStore":pstream%=0 480DIM q% 2500, workbuf% 1500,dialct% 24 490waiter%=0:file%=-1:v%=FNinitwimp:IFv%<180:MODE12:PROCerr(2) 500PROCwaitpoint:LIBRARY(FNdir+"BaseLib") 510LIBRARY(FNdir+"SwiList"):PROCswilist 520quit%=FALSE:dialreason%=-1:dialogue%=-1 530ackpending%=FALSE:ackref%=-1 540dragreason%=-1 550savereason%=-1 560file2%=-1:reason2%=-1 570menufile%=-1:menusub%=-1 580closeok%=FALSE 590sbfile%=-1:pass$="":exi0%=-1:exi1%=-1 600SYS"OS_Byte",182,0,255 TO,pterm% 610IF(pterm%AND&80)=0SYS"OS_Byte",246,0,255TO,pterm% 620IFpterm%=10pterm%=1:ELSEpterm%=2 630id_wcia%=42:id_exb%=43:id_bbc%=0 640DIM edbuf% 256,edval% 15 650edfield%=-1:edicon%=-1:edrec%=-1:edx%=-1:$edval%="a0-9\-+." 660ss%=12:lc%=3:PROCreadparams:PROCfilevars 670PROCloadsprites:PROCdefws:PROCdefmenus:PROCversion 680process%=1:checkref%=-1:delay%=0 690lastact%=0:chunk%=7:fn$="":startsort%=FALSE 700as$="Are you sure ?":rl$="Really ":ri$=rl$+"interrupt ?":fi$="File: " 710sy$="Sorry! ":DIM sortm$(4) 720VDU23,255,0,126,126,126,126,126,126,0 730sortsz%=HIMEM-TOP-60*1024:DIM V% sortsz% 740PROCass:PROCbaricon:ENDPROC 750 760DEFPROCswinums 770ENDPROC 780 790DEFPROCfilevars 800ft_form%=&DE7:ft_data%=&DE8:maxw%=4:maxf%=0 810DIM w%(maxw%),ma$(30),st%(maxf%,2) 820DIM fl%(maxf%),d$(maxf%,23),f$(maxf%),fx$(maxf%),t%(maxf%,3) 830DIM tw%(maxw%),e$(maxf%),r%(maxf%) 840DIM l$(maxf%),lx$(maxf%),lk$(maxf%),w$(maxf%,14) 850DIM wo%(maxf%),o$(maxf%),o%(maxf%,6),r$(maxf%),sr$(maxf%),ll%(maxf%,5) 860DIM lf%(maxf%,15),p%(maxf%,4),p$(maxf%,7),c$(maxf%,maxcol%,1) 870DIM c%(maxf%,maxcol%),ox$(maxf%) 880f_filt%=1<<00:f_pane%=1<<01:f_macb%=1<<02:f_mace%=1<<03 890f_fspc%=1<<04:f_fupp%=1<<05:f_sspc%=1<<06:f_supp%=1<<07 900f_sadd%=1<<08:f_rspc%=1<<09:f_rupp%=1<<10:f_srup%=1<<11 910f_stot%=1<<12:f_stit%=1<<13:f_sdas%=1<<14:f_wspc%=1<<15 920f_wupp%=1<<16:f_wbnk%=1<<17:f_7bit%=1<<18:f_rejb%=1<<19 930f_reja%=1<<20:f_rdsp%=1<<21:f_rtpn%=1<<22:f_rbpn%=1<<23 940f_rpdt%=1<<24:f_rtpg%=1<<25:f_rtsu%=1<<26:f_rldu%=1<<27 950f_rlsu%=1<<28 960f_reps%=f_rldu%ORf_rlsu%ORf_rejb%ORf_reja%ORf_rdsp%ORf_rtpn%ORf_rbpn%ORf_rpdt%ORf_rtpg%ORf_rtsu% 970f_save%=-1ANDNOT(f_pane%ORf_sadd%) 980f_dflt%=f_fspc%ORf_fupp%ORf_sspc%ORf_supp%ORf_stot%ORf_stit%ORf_sdas%ORf_wspc% 990fn$="":hand%=0 1000ENDPROC 1010 1020DEFPROCsdvars 1030SYSswi%,sd64_%,3TOlinegap% 1040margin%=8 1050IFsound%:SYSswi%,opt_%,10TOG%:ELSESYSswi%,opt_%,9TOG% 1060ENDPROC 1070 1080DEFPROCcheckprot:LOCALT%:SYS"FlexiFile_Address"TOsd% 1090LOCALERROR 1100ONERRORLOCAL:process%=2:ENDPROC 1110SYSswi%,reset_%,taskhandle% 1120IFprocess%=3PROCstop(1,"OK. Please remove original &","replace backup if necessary") 1130date$=FNstrdate1(FNnow,4) 1140PROCsdvars:IFFNv_(1)<>0PROCerr(3) 1150process%=4:ENDPROC 1160 1170DEFPROCversion 1180LOCALT$:T$=version$:IFNOTFNprod:T$+=" *UNFINISHED*" 1190PROCseti(w_pinfo%,4,"v"+T$):$FNtia(tw_status%,11)="v"+T$ 1200ENDPROC 1210 1220DEFFNprod=MID$(version$,INSTR(version$,".")+1,1)="0" 1230DEFFNdebug=NOTFNprod ANDINKEY-1ANDINKEY-2 1240 1250DEFFNinitwimp:first%=FALSE:taskhandle%=FNtask:IFtaskhandle%<>0:=200 1260$q%="TASK":SYS"Wimp_Initialise",200,!q%,"MultiStore"TO!q%,taskhandle% 1270first%=TRUE:=!q% 1280 1290DEFPROCtidy 1300LOCALERROR 1310PROCnormpoint 1320VDU4,26:PRINTTAB(0,3);:*fx4 1330*fx225,1 1340*fx229 1350Z%=0:SYSswi%,killtask_% 1360ONERRORLOCAL:RESTOREERROR:REPORT:PRINT" ";ERL:ENDPROC 1370PRINT;menuend%-menufree%" bytes menu space" 1380PRINT;endbuf%-curbuf%" bytes indirection buffer space" 1390PRINT;tbe%-tbs%" bytes template buffer" 1400ENDPROC 1410 1420DEFPROCbaricon:IFNOTfirst%:ENDPROC 1430!q%=-1:q%!4=0:q%!8=0:q%!12=102:q%!16=68 1440q%!20=%11000000000010:$(q%+24)="!"+LEFT$(appl$,9) 1450SYS"Wimp_CreateIcon",,q%TObaricon% 1460ENDPROC 1470 1480DEFPROCstrip(RETURN T$) 1490$sd%=T$:SYSswi%,strip_% 1500T$=$sd% 1510ENDPROC 1520 1530DEFPROCerror(err%,err$,erl%,quit%) 1540IFFNdebug:VDU4,30:PRINTerr$" @ ";erl%:PROCquit(TRUE) 1550PROCnormpoint:dragreason%=-1:@%=&90A:*fx229,1 1560LOCALi%,e%,t$,T$ 1570IFNOTFNprod:err$+=" ("+STR$ERL+")" 1580LOCALERROR 1590ONERRORLOCAL:PROCerror(ERR,REPORT$,ERL,TRUE) 1600!q%=err%:$(q%+4)=err$:SYS"Wimp_ReportError",q%,1,appl$ 1610IFquit%:PROCquit(FALSE) 1620ENDPROC 1630 1640DEFPROCreport:IFFNdebug:VDU4:REPORT:PRINT" @ ";ERL:PROCquit(TRUE) 1650ENDPROC 1660 1670DEFFNdir 1680LOCALT$:T$=FNArfVar(appl$+"$Dir") 1690IFT$="":T$="&.!"+LEFT$(appl$,9)+"." 1700IFRIGHT$(T$)<>".":T$+="." 1710=T$ 1720 1730DEFFNArfVar(A$):LOCALL%,T% 1740SYS"XOS_ReadVarVal",A$,workbuf%,254,0,3TO,,L%;T%:IFT%AND1:L%=0 1750workbuf%?L%=13:=$workbuf% 1760 1770DEFPROCumess1 1780ref%=q%!8:task%=q%!4:IFtask%=taskhandle%:ENDPROC 1790mess%=q%!16 1800CASEmess%OF 1810WHEN0:PROCCLOSE:PROCquit(FALSE) 1820WHEN1:PROCdatasaved 1830WHEN2:PROCsavedata 1840WHEN3:PROCdataload 1850WHEN4:ackpending%=FALSE 1860WHEN5:PROCdataopen 1870WHEN6: 1880WHEN7: 1890WHEN8:PROCprequit 1900WHEN9: 1910WHEN&502: 1920WHEN&400C0:PROCsubmenu(q%!20,q%!24,q%!28,q%+32) 1930WHEN&80300:PROCackrec 1940ENDCASE 1950ENDPROC 1960 1970DEFPROCdataopen 1980IFq%!40=ft_form%:PROCdataloadack:PROCerr(1) 1990IFq%!40<>ft_data%:ENDPROC 2000PROCdataloadack:mh%=-1:PROCcheckopen 2010IFprocess%=0:IFNOTFNdialogue:PROCmstore("2:"+FNzts(q%+44),"MultiStore") 2020ENDPROC 2030 2040DEFPROCdataload 2050LOCALT$:T$=FNzts(q%+44):del%=q%!12<>0 2060PROCreadpointer:PROCwtof(mh%) 2070CASE TRUE OF 2080WHEN q%!40=&1000:file$=FNzts(q%+44):PROCstop(38,RIGHT$(file$,29),rl$+" set picture path ?") 2090WHEN q%!40=ft_data%ANDmh%=-2 2100PROCdataloadack 2110IFprocess%=0IFNOTFNdialogue:PROCcheckopen:PROCmstore("3:"+T$,"MultiStore") 2120WHEN q%!40=&FFD ANDmh%=-2 2130IFprocess%=0:IFNOTFNdialogue:PROCcheckconv(T$) 2140WHEN q%!40=ft_form%ANDmh%=-2:PROCdataloadack:PROCerr(1) 2150WHEN q%!40=ft_form%ANDfile%>=0ANDwind%<2:PROCdataloadack:PROCerr(300) 2160WHEN q%!40=ft_data%ANDmh%=w_sort%:PROCcheckopen 2170IFINKEY-3:PROCopensort(T$):ELSEPROCopensort1(T$,7,0,"",0) 2180REM ;{n. ALT to open sort file with dialogue box 2190WHEN q%!40=&FFF ANDfile%>=0ANDwind%=4:PROCdataloadack:file$=T$:PROCstop(14,fi$+FNfilename,rl$+"load notes ?") 2200ENDCASE 2210ENDPROC 2220 2230DEFPROCnoscrap 2240IFdel%:*remove <Wimp$Scrap> 2250ENDPROC 2260 2270DEFPROCdatasaved:IFFNdialogue:ENDPROC 2280PROCreadpointer:PROCwtof(mh%) 2290CASE TRUE OF 2300WHEN q%!40=&FFF ANDfile%>=0AND(wind%=6ORwind%=7ORwind%=0):PROCdatasaveack 2310ENDCASE 2320ENDPROC 2330 2340DEFPROCerr(E%) 2350LOCALT$,A$:IFfile%>=0A$=", "+fi$+FNfilename+" - ":ELSEA$=" - " 2360@%=&90A:*fx229,1 2370CASEE%OF 2380WHEN0:T$=REPORT$ 2390WHEN1:T$="To use a format, drag it onto a card" 2400WHEN2:T$="Must be version 1.8 WIMP or later" 2410WHEN3:T$=sy$+"Too many files already open" 2420WHEN4:T$=sy$+"You can only run one RAMManager task at a time" 2430WHEN5:T$="To save, drag the icon to a directory viewer or another task" 2440WHEN6:T$="Couldn't open file: "+REPORT$:IFREPORT$="Data lost":T$+=" (Ensure the disc is not write protected)" 2450WHEN7:T$="Couldn't open format: "+REPORT$ 2460WHEN10:T$="Unbalanced quote marks ("")" 2470WHEN11:T$="Unbalanced brackets" 2480WHEN16:T$="Field names must start with a letter" 2490WHEN24:T$="Field assignment expected" 2500WHEN25:T$="Field name not specified" 2510WHEN29:T$="Illegal notepad reference identifier" 2520WHEN30:T$="Abbreviated expression too complex to expand" 2530WHEN31:T$="Illegal pattern matching" 2540WHEN35:T$="Expression should not be blank" 2550WHEN41:T$="Printer already in use" 2560WHEN46:T$="Exporting report"+A$+REPORT$+" (export cancelled)" 2570WHEN47:T$="The two new passwords must be identical. Please re-enter" 2580WHEN50:T$="Can't recognise format of setup file" 2590WHEN51:T$="You must specify the current password correctly" 2600WHEN59:T$="Program not found" 2610WHEN60:T$=REPORT$+" - Can't load requested software" 2620WHEN300:T$=sy$+"You can't load formats while sorting" 2630WHEN301:T$=sy$+"You can't open a file while another is open for sorting" 2640WHEN302:T$="Please close the sort file before cancelling sort mode" 2650WHEN303:T$="Please open sort file (by dragging to sort window) before proceeding" 2660WHEN305:T$=sy$+"You can't create a file while another is open for sorting" 2670WHEN306:T$="Sort expression"+A$+REPORT$ 2680WHEN307:T$=REPORT$+" - Sort failed" 2690WHEN308:T$="User interrupt acknowledged" 2700WHEN309:T$="Too many records for fast sort" 2710WHEN310:T$="Not enough records to sort!" 2720OTHERWISE:T$="Unrecognised internal error" 2730ENDCASE 2740IFNOTFNprod:T$+=" ("+STR$ERL+") ["+STR$E%+"]" 2750ERROR99,T$ 2760 2770DEFPROCopensort(f$):IFFNs(f$)="":ENDPROC 2780w_open%=FNcrwind(tw_open%):PROCunselall(w_open%):PROCseli(w_open%,8) 2790file$=f$:PROCseti(w_open%,13,f$):PROCseti(w_open%,14,"") 2800PROCshadeopen:PROCdialogue(w_open%):ENDPROC 2810 2820DEFPROCopensort1(f$,m%,d%,p$,r%):IFFNs(f$)="":ENDPROC 2830LOCALI%,g%,h%,X%,Y%,T$ 2840LOCALERROR 2850ONERRORLOCAL:RESTOREERROR:PROCloaderr:ENDPROC 2860p$=FNsu(p$) 2870IFFNv_(1)PROCerr(3) 2880PROCwaitpoint:T$=f$:m%=INT(99/(maxf%+1)+(99-(99/(maxf%+1)))*m%/7) 2890w%(0)=FNcrwind(tw%(0)) 2900IFp$=""p$=FNpwcode(pass$) 2910pass1$=p$:pass$=FNpwcode(p$):IFclearpass%pass$="" 2920SYSswi%,password_%,p$ 2930g%=0:SYSswi%,open_%,T$,m%,d%,r%TOG% 2940g%=G%:IFg%OR?sd%<>13THENPROCwarnfile:g%=TRUE 2950hand%=FNv_(2):PROCinitfile 2960SYSswi%,selectkey_%,"?" 2970SYSswi%,sd45_%,"N" 2980$FNta(w%(0))="Sort="+FNfilename:PROCfext:PROCreadws 2990PROCexpandsort 3000PROCopen(w%(0),16,404,512,900,0,0,-1):SYSswi%,grec_%,0TON% 3010SYSswi%,sd57_%,"bit7"TOG% 3020SYSswi%,order_%TON% 3030PROCflg(f_7bit%,G%) 3040PROCmakesort:PROCfastsort 3050SYSswi%,sd38_%,255 3060SYSswi%,sd38_%,255 3070fn$=f$:IFg%PROCdialogue(w_mess%) 3080ENDPROC 3090 3100DEFPROCwarnfile 3110LOCALT%,t%,I%,T$:w_mess%=FNcrwind(tw_mess%) 3120RESTORE+1:FORI%=0TO7:READT$ 3130IFg%AND(2^I%):PROCseti(w_mess%,T%,T$):T%+=1 3140NEXT:IF$sd%>""THEN 3150PROCseti(w_mess%,T%,"Password violations have occured as follows:"):T%+=1 3160t%=sd%:REPEAT 3170IFt%<sd%+192:IF$t%>"":PROCseti(w_mess%,T%," Using "+$t%):T%+=1 3180t%+=64:UNTILt%=sd%+192 3190ENDIF 3200WHILET%<6:PROCseti(w_mess%,T%,""):T%+=1:ENDWHILE:ENDPROC 3210DATA"** This file MAY be CORRUPTED due to illegal closure **" 3220DATA" ** This file has been accessed by older software **" 3230DATA,,,, 3240 3250DEFPROCinitfile 3260f$(h%)="":fx$(h%)="":e$(h%)="":r%(h%)=1 3270o$(h%)="":o%(h%,0)=7:r$(h%)="":FORI%=0TO3:t%(h%,I%)=0:NEXT 3280l$(h%)="":lk$(h%)="":lx$(h%)="":sr$(h%)="" 3290p%(h%,0)=0:p$(h%,0)="" 3300FORI%=0TO23:d$(h%,I%)="":NEXT:FORI%=0TO18:PROCnote(I%,""):NEXT 3310FORI%=0TO29:ma$(I%)="":NEXT:wo%(h%)=0 3320FORI%=0TO15:lf%(h%,I%)=0:NEXT:FORI%=0TO14:w$(h%,I%)="":NEXT 3330ll%(h%,0)=30:ll%(h%,1)=4:ll%(h%,2)=4:ll%(h%,3)=9:ll%(h%,4)=2:ll%(h%,5)=1 3340fl%(h%)=f_dflt% 3350ENDPROC 3360 3370DEFPROCloaderr 3380PROCnormpoint:IFh%>=0THEN 3390IFg%:PROCdelw(w_mess%) 3400IFw%(0)>0PROCdelw(w%(0)) 3410IFhand%>0:PROCclosefile 3420IFERR=&80301THEN 3430w_open%=FNcrwind(tw_open%):PROCunselall(w_open%):PROCseli(w_open%,m%+1) 3440IFd%PROCseli(w_open%,0) 3450file$=f$:PROCseti(w_open%,13,f$):PROCseti(w_open%,14,"") 3460PROCshadeopen:PROCdialogue(w_open%):file%=-1:ENDPROC 3470ENDIF 3480ENDIF 3490file%=-1:PROCerr(6):ENDPROC 3500 3510DEFPROCclosefile:LOCALI% 3520PROCready:PROCwritews:PROCdelfilews 3530hand%=0:w%(0)=-1E9 3540closeok%=FALSE 3550SYSswi%,close_%TOS% 3560PROCfastsort 3570ENDPROC 3580 3590DEFPROCalign(I%):IFtx1%-tx0%>108:ENDPROC 3600tx0%=I%*40+16:tx1%=tx0%+440 3610ty1%=900-I%*40:ty0%=ty1%-320 3620ENDPROC 3630 3640DEFPROCmakeflist:LOCALX%,Y%,P%,T% 3650P%=FNmakewind(2):T%=FNta(P%):$T%="Fields="+FNfilename 3660T%=LEN$T%+4:SYSswi%,sd64_%,1TOG% 3670IFG%<T%G%=T% 3680X%=G%:IFX%<21X%=21 3690Y%=FNv_(7):IFY%<2Y%=2 3700PROCwext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2) 3710ENDPROC 3720 3730DEFPROCmakenotes 3740LOCALP%:P%=FNmakewind(4):$FNta(P%)="Notepad="+FNfilename 3750ENDPROC 3760 3770DEFPROCmakesubs 3780LOCALP%,T$,I%,J%,K%,T% 3790K%=w%(1)>0:IFK%PROCgetw(w%(1))ELSEPROCreadblock(tw%(1)) 3800tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:PROCalign(1) 3810PROCdelfilew(1):P%=FNcrwind(tw%(1)):w%(1)=P% 3820$FNta(w%(1))="Subsets of "+FNfilename 3830T$=FNsubstr:FORI%=0TO23 3840IFMID$(T$,I%+1,1)<>".":PROCloseicon(P%,I%+5):PROCloseicon(P%,I%+29) 3850NEXT 3860WHILET$>""ANDRIGHT$(T$)<>".":T$=LEFT$(T$):ENDWHILE:T$=LEFT$(T$,24) 3870C%=((LENT$-1)DIV6+1)*56+62:IFK%:C%=ty1%-ty0% 3880T%=(3-(LENT$-1)DIV6)*56:J%=0:FORI%=0TO9:T$=FNsubname(I%) 3890PROCseti(P%,I%+53,T$):IFT$=""THEN 3900PROCloseicon(P%,I%+53) 3910ELSE 3920PROCgeti(P%,I%+53):PROCdelicon(P%,I%+53):J%=I%+1 3930q%!4=!q%:q%!12+=T%:q%!20+=T%:SYS"Wimp_CreateIcon",,q%+4 3940ENDIF 3950NEXT:PROCgeti(P%,4):PROCdelicon(P%,4) 3960q%!4=!q%:q%!12+=T%:q%!20+=T%:SYS"Wimp_CreateIcon",,q%+4 3970T%+=((10-J%)DIV5)*64:PROCgetw(P%):PROCwext(P%,ex1%,-ey0%-T%) 3980PROCopen(w%(1),tx0%,ty1%-C%,tx1%+x1%-x0%,ty1%,0,0,-1):PROCshowsub 3990ENDPROC 4000 4010DEFPROCmakesort 4020LOCALP%,X%,Y%:P%=FNmakewind(3):$FNta(P%)="Sort="+FNfilename 4030X%=255:Y%=FNv_(17):PROCwext(w%(3),X%*16+margin%*2,Y%*linegap%+margin%*2) 4040ENDPROC 4050 4060DEFPROCsubs 4070IFw%(1)<=0:PROCmakesubs:ENDPROC 4080PROCfront(w%(1),-1,-1) 4090ENDPROC 4100 4110DEFPROCsortw 4120IFw%(3)<=0:PROCmakesort:ENDPROC 4130PROCfront(w%(3),-1,-1) 4140ENDPROC 4150 4160DEFFNmakewind(T%):LOCALP%,I%,K% 4170K%=w%(T%)>0:IFK%PROCgetw(w%(T%))ELSEPROCreadblock(tw%(T%)) 4180tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:PROCalign(T%) 4190PROCdelfilew(T%):P%=FNcrwind(tw%(T%)):w%(T%)=P% 4200PROCopen(P%,tx0%,ty0%,tx1%,ty1%,0,0,-1):=P% 4210 4220DEFFNcrwind(T%):SYS"Wimp_CreateWindow",,T%TOT%:=T% 4230 4240DEFPROCshowsub:LOCALP% 4250P%=w%(1):IFP%>0THEN 4260PROCsubdisp1:PROCunselall(P%):IFFNv_(11)=0THEN 4270PROCseli(P%,1) 4280ELSE 4290PROCseli(P%,(FNv_(11)AND31)+28) 4300IFFNv_(11)>31:PROCseli(P%,(FNv_(11)AND31)+4) 4310ENDIF 4320ENDIF 4330ENDPROC 4340 4350DEFPROCdelfilews:LOCALI%:IFw%(0)>0PROCdelw(w%(0)) 4360FORI%=1TOmaxw%:PROCdelfilew(I%):NEXT:ENDPROC 4370 4380DEFPROCdelfilew(I%) 4390IFw%(I%)>0:PROCclosew(w%(I%)):IFw%(I%)>0PROCdelw(w%(I%)) 4400ENDPROC 4410 4420DEFPROCumess2 4430CASEq%!16OF 4440WHEN6:IFq%!8=loadref%:PROCdatasaveack:ENDPROC 4450ENDCASE 4460ENDPROC 4470 4480DEFPROCbackgrnd:LOCALT% 4490IFsbfile%>=0PROCsubdisp 4500IFstartsort%:startsort%=FALSE:PROCnewdelay:PROCsortfile 4510IFackpending%:ackpending%=FALSE 4520ENDPROC 4530 4540DEFPROCtemplate(T$) 4550PROCtemplate1(T$,q%) 4560ENDPROC 4570 4580DEFPROCtemplate1(T$,q%):T$=FNlower(T$):LOCAL I%,T%,L% 4590I%=temp%+16:WHILE!I%>0ANDFNlower($(I%+12))<>T$:I%+=24:ENDWHILE 4600IF!I%<=0:ERROR99,"Template '"+T$+"' not found" 4610T%=temp%+!I%:L%=I%!4:FORI%=0TOL%STEP4:q%!I%=T%!I%:NEXT:T%=q%+88+q%!84*32 4620IF(q%!56)AND(1<<8)THEN 4630q%!72=FNworkspace(q%!80):$(q%!72)=$T%:T%+=LEN$T%+1 4640IFq%!76>0:q%!76=FNworkspace(LEN$T%+1):$(q%!76)=$T%:T%+=LEN$T%+1 4650ENDIF 4660IFq%!84>0THEN 4670FORI%=q%+88TOq%+84+q%!84*32STEP32 4680IF(I%!16)AND(1<<8)THEN 4690I%!20=FNworkspace(I%!28):$(I%!20)=$T%:T%+=LEN$T%+1 4700IFI%!24>0:I%!24=FNworkspace(LEN$T%+1):$(I%!24)=$T%:T%+=LEN$T%+1 4710ENDIF 4720NEXT 4730ENDIF 4740q%!64=sprites% 4750ENDPROC 4760 4770DEFPROCopentemplate(A$):temp%=HIMEM-30000 4780OSCLI"Load "+A$+" "+STR$~temp%:ENDPROC 4790 4800DEFFNtemplate(T$) 4810PROCtemplate1(T$,tbs%) 4820T%=tbs%:tbs%+=88+tbs%!84*32 4830IFtbs%>tbe%:ERROR99,"Template buffer full" 4840=T% 4850 4860DEFPROCdefws 4870LOCALI% 4880bufsz%=&1200 4890DIM buffer% bufsz%:curbuf%=buffer%:endbuf%=buffer%+bufsz% 4900PROCopentemplate(FNdir+"MSFrm7") 4910PROCtemplate("stopbox"):SYS"Wimp_CreateWindow",,q%TOw_stop% 4920PROCtemplate("save") 4930q%!64=1:SYS"Wimp_CreateWindow",,q%TOw_save% 4940PROCtemplate("ProgInfo"):SYS"Wimp_CreateWindow",,q%TOw_pinfo% 4950PROCtemplate("ProgInfo2"):SYS"Wimp_CreateWindow",,q%TOw_pinfo2% 4960PROCtemplate("shadow"):SYS"Wimp_CreateWindow",,q%TOw_shadow% 4970bufsz%=&1F00 4980DIM template% bufsz%:tbs%=template%:tbe%=tbs%+bufsz% 4990tw%(0)=FNtemplate("File") 5000tw%(1)=FNtemplate("Subsets") 5010tw%(2)=FNtemplate("FieldList") 5020tw%(3)=FNtemplate("FieldList") 5030tw%(4)=FNtemplate("Notepad") 5040PROCopentemplate(FNdir+"MSFrm8") 5050tw_status%=FNtemplate("Status"):w_status%=-1E9 5060tw_mess%=FNtemplate("message"):w_mess%=-1E9 5070tw_sort%=FNtemplate("sort"):w_sort%=-1E9 5080tw_open%=FNtemplate("open"):w_open%=-1E9 5090tw_sortex%=FNtemplate("Sortex"):w_sortex%=-1E9 5100ENDPROC 5110 5120DEFPROCloadsprites 5130ssize%=16*1024 5140DIMsprites% ssize% 5150!sprites%=ssize%:SYS"OS_SpriteOp",&109,sprites% 5160SYS"OS_SpriteOp",&10A,sprites%,FNdir+"MSSpr" 5170ENDPROC 5180 5190DEFPROCdefmenus 5200LOCALt$ 5210DIM mlist% 32 5220bufsz%=1100 5230DIM menufree% bufsz%:menuptr%=menufree%:menuend%=menufree%+bufsz% 5240menustart%=menufree%:RESTORE+2 5250READt$:m_main%=FNcrmenu(t$) 5260DATA"#MultiStore,Info>w_pinfo%,Transfer,Fast Sort,Create,Status,Printer,Quit" 5270READt$:m_wind%=FNcrmenu(t$) 5280DATA"#Window,Subsets,Field,Sort,Notepad#,Tidy Up" 5290READt$:m_file%=FNcrmenu(t$) 5300DATA"#File,Open" 5310READt$:m_card%=FNcrmenu(t$) 5320DATA"#Card,File>m_file%,Window>m_wind%" 5330READt$:m_npad%=FNcrmenu(t$) 5340DATA"#Notepad,Clear,Export>w_save%" 5350ENDPROC 5360 5370DEFPROCfront(h%,X%,Y%) 5380PROCgetw(h%) 5390IFX%>=0x1%+=X%-x0%:x0%=X% 5400IFY%>=0y1%+=Y%-y0%:y0%=Y% 5410PROCopen(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1) 5420ENDPROC 5430 5440DEFPROCopen(oh%,ox0%,oy0%,ox1%,oy1%,oscx%,oscy%,obh%) 5450LOCALO% 5460!q%=oh%:SYS"Wimp_GetWindowState",,q% 5470PROCwtof(oh%):IFfile%>=0THEN 5480CASEwind%OF 5490OTHERWISE:PROCwimpopen 5500ENDCASE 5510ELSE 5520CASEoh%OF 5530OTHERWISE:PROCwimpopen 5540ENDCASE 5550ENDIF 5560IFoh%=dialogue%ANDshadows%:PROCgetw(oh%):PROCopen(w_shadow%,x0%+ss%,y0%-ss%,x1%+ss%,y1%-ss%,0,0,dialogue%) 5570open%=O% 5580ENDPROC 5590 5600DEFPROCwimpopen 5610!q%=oh%:q%!4=ox0%:q%!8=oy0%:q%!12=ox1%:q%!16=oy1% 5620q%!20=oscx%:q%!24=oscy%:q%!28=obh%:SYS"Wimp_OpenWindow",,q% 5630ENDPROC 5640 5650DEFPROCclosew(!q%) 5660LOCALI% 5670PROCwtof(!q%) 5680IFfile%>=0THEN 5690CASEwind%OF 5700WHEN0:IFFNshowbranch:ENDPROC:ELSEIFNOTcloseok%:PROCcloseok:ENDPROC 5710ENDCASE 5720ENDIF 5730IF!q%=dialogue%:PROCtidydial 5740SYS"Wimp_CloseWindow",,q% 5750PROCnodial:PROCwtof(!q%):IFfile%>=0THEN 5760CASEwind%OF 5770WHEN0:PROCclosefile 5780WHEN1,2,3,4:PROCdelw(w%(wind%)) 5790ENDCASE 5800ELSE 5810CASE!q%OF 5820WHENw_stop%:stopfile%=-1 5830WHENw_status%:PROCdelw(w_status%) 5840WHENw_mess%:PROCdelw(w_mess%) 5850WHENw_open%:PROCdelw(w_open%) 5860WHENw_sort%:PROCdelw(w_sort%) 5870WHENw_sortex%:PROCdelw(w_sortex%) 5880ENDCASE 5890ENDIF 5900ENDPROC 5910 5920DEFPROCtidydial:PROCrestorect 5930dialreason%=-1:dialogue%=-1:PROCclosew(w_shadow%):exi0%=-1:exi1%=-1 5940ENDPROC 5950 5960DEFPROCrestorect 5970LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 5980SYS "Wimp_GetCaretPosition",,workbuf% 5990IF!workbuf%=dialogue%SYS "Wimp_SetCaretPosition",!dialct%,dialct%!4,dialct%!8,dialct%!12,dialct%!16,dialct%!20 6000ENDPROC 6010 6020DEFPROCdelw(RETURN T%):!q%=T%:SYS"Wimp_DeleteWindow",,q%:T%=-1E9:ENDPROC 6030 6040DEFFNia(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!28 6050DEFFNva(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!32 6060DEFFNil(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!36 6070 6080DEFFNtia(T%,i%):LOCALq%:q%=T%+32*i%+88:PROCchkii:=q%!20 6090 6100DEFPROCchkii:IF(q%!24AND&100)=0ERROR1,"Icon not indirected" 6110ENDPROC 6120 6130DEFPROCgeti(h%,i%):!q%=h%:q%!4=i%:SYS"Wimp_GetIconState",,q%:ENDPROC 6140 6150DEFFNta(h%):!q%=h%:SYS"Wimp_GetWindowInfo",,q% 6160IF(q%!60AND&100)=0ERROR1,"Title not indirected" 6170=q%!76 6180 6190DEFPROCstop(r%,T$,U$) 6200dialreason%=r%:stopfile%=T% 6210IFINKEY-3ORNOTstopboxes%:mi%=3:PROCmstop:ENDPROC 6220PROCseti(w_stop%,0,T$):PROCseti(w_stop%,1,U$) 6230PROCunselall(w_stop%):PROCdialogue(w_stop%) 6240dialreason%=r%:stopfile%=T% 6250ENDPROC 6260 6270DEFPROCdialogue(h%) 6280LOCALX%,Y%:PROCnodial 6290SYS "Wimp_GetCaretPosition",,dialct% 6300dialfile%=file%:PROCnomenu:PROCreadpointer:X%=mx%-200:Y%=my%-85 6310IFX%<0X%=0 6320IFY%<96Y%=96 6330dialogue%=h%:PROCfront(h%,X%,Y%):PROCsetct(h%,-1,-1) 6340RESTORE12380:REPEAT 6350PROCreadh(h%):IFh%=dialogue%:READX%:PROCsetct(h%,X%,LEN$FNia(h%,X%)) 6360IFh%<>-1:REPEAT:READX%:UNTILX%<-1:h%=0 6370UNTILh%=dialogue%ORh%<0:ENDPROC 6380 6390DEFPROCreadpointer:LOCALq%:q%=workbuf% 6400SYS"Wimp_GetPointerInfo",,q% 6410mx%=!q%:my%=q%!4:mb%=q%!8:mh%=q%!12:mi%=q%!16 6420ENDPROC 6430 6440DEFFNdialogue:LOCALfile% 6450IFdialogue%>=0ANDmh%<>dialogue%ANDmh%<>w_shadow%PROCnodial 6460=FALSE 6470 6480DEFPROCmouse(mx%,my%,mb%,mh%,mi%,mo%) 6490IFdragreason%>=0ORmb%>255:ENDPROC 6500PROCwtof(mh%):IFfile%>=0ANDwind%=4AND(mb%=1ORmb%=4)ANDmi%<19:ENDPROC 6510IFmb%<16:IFFNdialogue:ENDPROC 6520w_info%=w_pinfo%:IFmb%=7:mb%=2:w_info%=w_pinfo2% 6530CASEmb%OF 6540WHEN2:PROCmenu 6550WHEN1,4:PROCselect 6560WHEN16,64:PROCstartdrag 6570ENDCASE 6580ENDPROC 6590 6600DEFPROCseti(h%,i%,T$):T$=LEFT$(T$,FNil(h%,i%)):$FNia(h%,i%)=T$ 6610PROCiconupd(h%,i%):PROCgetct:IF!q%=h%ANDq%!4=i%:PROCsetct(h%,i%,LENT$) 6620ENDPROC 6630 6640DEFPROCiset(h%,i%,B%,E%):LOCALq%:q%=workbuf% 6650!q%=h%:q%!4=i%:q%!12=B%:q%!8=E%:SYS"Wimp_SetIconState",,q%:ENDPROC 6660 6670DEFPROCiconupd(h%,i%):PROCiset(h%,i%,0,0):ENDPROC 6680 6690DEFPROCforce(h%) 6700CASEh%OF 6710OTHERWISESYS"Wimp_ForceRedraw",h%,-1E9,-1E9,1E9,1E9 6720ENDCASE 6730ENDPROC 6740 6750DEFPROCreadblock(p%) 6760x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12 6770scx%=p%!16:scy%=p%!20:bhandle%=p%!24 6780bx%=x0%-scx%:by%=y1%-scy% 6790ex0%=p%!40:ey0%=p%!44:ex1%=p%!48:ey1%=p%!52 6800gx0%=p%!24:gy0%=p%!28:gx1%=p%!32:gy1%=p%!36 6810open%=(p%!28AND&10000)<>0 6820ENDPROC 6830 6840DEFPROCgetw(h%) 6850!q%=h%:SYS"Wimp_GetWindowInfo",,q% 6860PROCreadblock(q%+4) 6870ENDPROC 6880 6890DEFPROCselect 6900IFfile%>=0THEN 6910CASEwind%OF 6920WHEN1:PROCmsubs 6930WHEN3:PROCmsortw 6940ENDCASE 6950ELSE 6960CASEmh%OF 6970WHEN-2:IFmb%=1ANDINKEY-1ANDINKEY-2:PROCoscli(""):ELSEPROCstatus 6980WHENw_stop%:PROCmstop 6990WHENw_save%:PROCmsave 7000WHENw_status%:PROCmstatus 7010WHENw_mess%:IFmi%=6:PROCclosew(w_mess%) 7020WHENw_sort%:PROCmsort 7030WHENw_open%:PROCmopen 7040WHENw_sortex%:PROCmexpr 7050ENDCASE 7060ENDIF 7070ENDPROC 7080 7090DEFPROCmsort 7100IFmi%=3ANDFNv_(1)>0PROCerr(302) 7110IFmi%=3:PROCclosew(w_sort%):ENDPROC 7120IFmi%=4ANDFNv_(1)=0:PROCerr(303) 7130IFmi%=-1:PROCfront(w_sort%,-1,-1) 7140IFmi%<>4:ENDPROC 7150startsort%=TRUE:PROCnewdelay:PROCfront(w_sort%,-1,-1):ENDPROC 7160ENDPROC 7170 7180DEFPROCmsubs 7190LOCALT%:T%=FNitos:IFT%>=0:PROCselsub(T%):ENDPROC 7200ENDPROC 7210 7220DEFPROCmsortw 7230PROCexpr 7240ENDPROC 7250 7260DEFPROCmopen:IFmi%=11PROCclosew(w_open%) 7270IFmi%<>12ENDPROC 7280LOCALI%,m%,d%,r%,p$ 7290p$=$FNia(w_open%,14):PROCwchi(w_open%):I%=q%:REPEAT 7300IF!I%=0:d%=TRUE 7310IF!I%>0AND!I%<9:m%=!I%-1 7320IF!I%=16:r%=TRUE 7330I%+=4:UNTILI%!-4<0:file$=$FNia(w_open%,13):PROCclosew(w_open%) 7340PROCopensort1(file$,m%,d%,p$,r%):ENDPROC 7350 7360DEFPROCmexpr 7370LOCALA%,T$,a%,c%,s%,u%,I%,Q%,B%:PROCunseli(w_sortex%,29) 7380A%=FNia(w_sortex%,17):PROCqbscan($A%,Q%,B%) 7390CASEmi%OF 7400WHEN2,3,4,5,6,7,8,9 7410IF$A%>""ANDNOTQ%$sd%=MID$("+-*/=<><()",mi%-1,1):IF$sd%<>RIGHT$($A%)T$=$sd% 7420IFmi%=7:IFT$>"":T$+=">" 7430PROCseti(w_sortex%,17,$A%+T$) 7440WHEN10,11 7450IF(($A%>""ANDB%>0)ORmi%=10)ANDNOTQ%:$sd%=MID$("()",mi%-9,1):PROCseti(w_sortex%,17,$A%+$sd%) 7460WHEN12,13 7470T$=$A%:IF$A%>""ANDNOTQ%THEN 7480$sd%=RIGHT$($A%):SYSswi%,upper_% 7490IF($sd%>="A"AND$sd%<="Z")OR($sd%>="0"AND$sd%<="9")T$+=" " 7500IFmi%=12T$+="AND"ELSET$+="OR" 7510ENDIF 7520PROCseti(w_sortex%,17,T$) 7530WHEN14:IF$A%>""ANDNOTQ%T$=$A%+"=""**""":PROCseti(w_sortex%,17,T$):PROCsetct(w_sortex%,17,LEN$A%-2) 7540WHEN15:IF$A%>""ANDNOTQ%T$=$A%+"~=""""":PROCseti(w_sortex%,17,T$):PROCsetct(w_sortex%,17,LEN$A%-1) 7550WHEN20,21:PROCsubs 7560WHEN22:PROCnodial 7570WHEN29:IF$A%=""PROCseti(w_sortex%,17,ex$):ELSEex$=$A%:PROCseti(w_sortex%,17,"") 7580WHEN23 7590PROCwchi(w_sortex%):I%=q%:REPEAT 7600CASE!I%OF 7610WHEN1:s%=TRUE 7620WHEN0:u%=TRUE 7630WHEN19:a%=TRUE 7640WHEN28:c%=TRUE 7650ENDCASE 7660I%+=4:UNTILI%!-4=-1 7670IFu%:PROCupplit($A%) 7680PROCseti(w_sortex%,17,$A%) 7690o%(0,0)=(s%AND4)OR(u%AND2)OR(a%AND1) 7700T$=FNx1($A%):o$(0)=$A%:ox$(0)=T$ 7710PROCnodial:IFw%(3)>0PROCforce(w%(3)) 7720ENDCASE 7730PROCiconupd(w_sortex%,17) 7740ENDPROC 7750 7760DEFPROCmstop:IFmi%<3ORmi%>4ENDPROC 7770LOCALT%:T%=dialreason%:dialreason%=-1 7780IFmi%=3THEN 7790PROCclosew(w_stop%) 7800CASET%OF 7810WHEN2:closeok%=TRUE:PROCclosew(w%(0)) 7820WHEN6:PROCCLOSE:PROCquit(FALSE) 7830WHEN14:PROCloadnotes 7840WHEN17:PROCclearnpad 7850WHEN20:stopboxes%=FALSE 7860WHEN36:OSCLI"*settype "+file$+" "+STR$~menufield% 7870IFmenufield%=ft_data%:PROCcheckopen:PROCmstore("3:"+file$,"MultiStore") 7880WHEN38:PROCpicpath 7890ENDCASE 7900ELSE 7910IFT%=1:PROCCLOSE:PROCquit(FALSE) 7920ENDIF 7930PROCclosew(w_stop%):ENDPROC 7940 7950DEFPROCmsave 7960IFmi%<>0ENDPROC 7970LOCALT$:T$=$FNia(w_save%,2):IFT$=FNleaf(T$):PROCerr(5) 7980savetype%=savet%:task%=-1:file$=T$:PROCsavedata1 7990ENDPROC 8000 8010DEFPROCmstatus 8020LOCALT%,I%,A% 8030CASEmi%OF 8040WHEN15:IFw%(0)>0:PROCfront(w%(0),-1,-1) 8050WHEN12 8060WHEN13 8070sound%=FALSE:shadows%=FALSE:pix%=FALSE 8080PROCwchi(w_status%):I%=q%:REPEAT 8090CASE!I%OF 8100WHEN24:sound%=TRUE 8110WHEN25:shadows%=TRUE 8120WHEN23:A%=TRUE 8130WHEN28:pix%=TRUE 8140ENDCASE 8150I%+=4:UNTILI%!-4<0 8160IFsound%:SYSswi%,opt_%,10TOG%:ELSESYSswi%,opt_%,9TOG% 8170IFA%<>stopboxes%THEN 8180IFA%stopboxes%=TRUE:ELSEPROCstop(20,rl$+"disable these","stop boxes ?"):ENDPROC 8190ENDIF 8200OTHERWISEENDPROC 8210ENDCASE 8220PROCclosew(w_status%):ENDPROC 8230 8240DEFPROCstartdrag 8250dragreason%=-1:dragbutton%=mb% 8260PROCwtof(mh%):IFfile%>=0THEN 8270CASEwind%OF 8280WHEN0 8290IFmb%=16dragreason%=4:PROCdragcard:ELSEmenufield%=FNmousef:IFmenufield%>0dragreason%=3:PROCdragfield 8300WHEN1 8310menusub%=FNitos:IFmenusub%>=0:dragreason%=2:PROCdragicon(mh%,mi%) 8320WHEN2 8330menufield%=my%:PROCyconv(menufield%,FNv_(7),mh%) 8340dragreason%=3:PROCdragfield1 8350WHEN4:IFmi%<19:dragreason%=6:menufield%=mi%:PROCdragicon(mh%,mi%) 8360ENDCASE 8370ELSE 8380CASEmh%OF 8390WHENw_save%:IFmi%=3:dragreason%=5:PROCdragicon(w_save%,3) 8400ENDCASE 8410ENDIF 8420ENDPROC 8430 8440DEFPROCenddrag 8450PROCreadpointer 8460IFmh%<>-1THEN 8470LOCALT$ 8480CASEdragreason%OF 8490WHEN1:PROCcarddr 8500WHEN2:PROCsubsdr 8510WHEN3:PROCfielddr 8520WHEN4:PROCcarddr1 8530WHEN5:PROCsavereq(FNleaf($FNia(w_save%,2)),savet%,saves%,savereason%) 8540WHEN6:IFFNenternote 8550ENDCASE 8560ELSE 8570IFdragreason%=4:PROCcarddr1 8580ENDIF 8590dragreason%=-1:menufile%=-1 8600ENDPROC 8610 8620DEFPROCunseli(h%,i%):PROCiset(h%,i%,&200000,0):ENDPROC 8630 8640DEFPROCseli(h%,i%):PROCiset(h%,i%,&200000,&200000):ENDPROC 8650DEFPROCshadei(h%,i%):PROCiset(h%,i%,&400000,&400000):ENDPROC 8660 8670DEFPROCunselall(h%) 8680LOCALI%,i%:PROCwchi(h%) 8690I%=q%:REPEAT:i%=!I%:IFi%>=0:PROCunseli(h%,i%) 8700I%+=4:UNTILi%<0:ENDPROC 8710 8720DEFPROCwchi(h%):SYS"Wimp_WhichIcon",h%,q%,&200000,&200000 8730ENDPROC 8740 8750DEFPROCmenu 8760PROCwtof(mh%):IFfile%>=0THEN 8770CASEwind%OF 8780WHEN0:PROCcardmenu 8790WHEN3:PROCmsortw 8800WHEN4:PROCpop(m_npad%,-1) 8810ENDCASE 8820ELSE 8830CASEmh%OF 8840WHEN-2:my%=64+7*44:PROCpop(m_main%,-1) 8850ENDCASE 8860ENDIF 8870ENDPROC 8880 8890DEFPROCcardmenu:PROCpop(m_card%,-1):ENDPROC 8900 8910DEFFNpar(t$,s$,RETURN i%):LOCALi1% 8920i1%=i%+1:i%=INSTR(t$+s$,s$,i1%) 8930=MID$(t$,i1%,i%-i1%) 8940 8950DEFFNcrmenu(menu$) 8960IFmenufree%+28>menuend%ERROR99,"Menu area full" 8970LOCAL m% 8980menuptr%=menufree% 8990i%=0 9000IF LEFT$(menu$,1)="#"i%=1:menutitle$=FNpar(menu$,",",i%)ELSEmenutitle$="" 9010$menuptr%=menutitle$ 9020menuptr%?12=7:menuptr%?13=2:menuptr%?14=7:menuptr%?15=0 9030menuptr%!16=196-24:menuptr%!20=44:menuptr%!24=0 9040menuptr%+=28:maxx%=LENmenutitle$ 9050REPEATitem$=FNpar(menu$,",",i%) 9060PROCmenuitem(item$) 9070UNTIL item$="" 9080m%=menufree%:m%!16=(maxx%*8+6)*2 9090menufree%=menuptr% 9100=m% 9110 9120DEFPROCmenuitem(text$) 9130IFtext$=""menuptr%!-24=(menuptr%!-24)OR&80:ENDPROC 9140IFmenuptr%+24>menuend%THENERROR99,"Menu area full" 9150LOCALi%,flg% 9160flg%=&00 9170i%=INSTR(text$,">") 9180IFi%>0subptr%=EVALMID$(text$,i%+1):text$=LEFT$(text$,i%-1)ELSEsubptr%=-1 9190i%=INSTR(text$,"}") 9200IFi%>0subptr%=EVALMID$(text$,i%+1):text$=LEFT$(text$,i%-1):flg%+=&08 9210IFRIGHT$(text$,1)="#"text$=LEFT$(text$):flg%+=&02 9220menuptr%!0=flg%:menuptr%!4=subptr%:menuptr%!8=&07000021 9230IFLEFT$(text$,1)="$"THEN 9240!menuptr%+=&04:menuptr%!8+=&100:i%=INSTR(text$,"(") 9250IFi%>0THENL%=VALMID$(text$,i%+1):text$=LEFT$(text$,i%-1)ELSEL%=12 9260menuptr%!12=EVALMID$(text$,2):menuptr%!16=-1:menuptr%!20=L% 9270text$=STRING$(L%," ") 9280ELSE 9290IFLENtext$<=12THEN 9300$(menuptr%+12)=text$ 9310ELSE 9320I%=FNworkspace(LENtext$+1):$I%=text$ 9330menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=LENtext$+1 9340menuptr%!8=menuptr%!8 OR &100 9350ENDIF 9360IFLENtext$>maxx%maxx%=LENtext$ 9370ENDIF 9380menuptr%+=24 9390ENDPROC 9400 9410DEFFNworkspace(L%) 9420IF curbuf%+L%>endbuf%ERROR99,"No more buffer space" 9430curbuf%+=L%:=curbuf%-L% 9440 9450DEFPROCprep(menu%,tree%) 9460LOCALI%,T$:PROCclearts(menu%) 9470CASEmenu%OF 9480WHENm_main%:PROCmp_main 9490WHENm_file%:PROCmp_file 9500WHENm_wind%:PROCmp_wind 9510WHENm_card%:PROCmp_card 9520WHENm_npad%:PROCmp_npad 9530ENDCASE 9540ENDPROC 9550 9560DEFPROCmp_card 9570PROCprep(m_wind%,tree%) 9580ENDPROC 9590 9600DEFPROCmp_file 9610ENDPROC 9620 9630DEFPROCmp_wind 9640IFw%(1)>0PROCtick(menu%,0) 9650IFw%(2)>0PROCtick(menu%,1) 9660IFw%(3)>0PROCtick(menu%,2) 9670IFw%(4)>0PROCtick(menu%,3) 9680ENDPROC 9690 9700DEFPROCmp_npad 9710PROCsaveset(f_np$,&FFF,5,80*19) 9720ENDPROC 9730 9740DEFPROCmp_main 9750IFFNv_(1)>0:PROCshade(menu%,1):PROCshade(menu%,2):PROCshade(menu%,3):PROCshade(menu%,5) 9760IFw_sort%>0PROCtick(menu%,2) 9770ENDPROC 9780 9790DEFPROCpop(menu%,tree%):IFprocess%>0:ENDPROC 9800IFmenu%<0:ENDPROC 9810PROCprep(menu%,tree%) 9820SYS"Wimp_CreateMenu",,menu%,mx%-50,my%+32 9830openmenu%=menu% 9840ENDPROC 9850 9860DEFPROCnomenu 9870SYS"Wimp_CreateMenu",,-1:openmenu%=-1 9880ENDPROC 9890 9900DEFPROCnodial:IFdialogue%>0PROCclosew(dialogue%) 9910ENDPROC 9920 9930DEFPROCmenuselect 9940LOCALI% 9950I%=0:REPEATmlist%!I%=q%!I%:I%+=4:UNTILq%!(I%-4)=-1 9960PROCreadpointer 9970CASEopenmenu%OF 9980WHENm_main%:PROCm_main 9990WHENm_card%:PROCm_card 10000WHENm_npad%:PROCm_npad 10010ENDCASE 10020IFmb%=1THEN 10030PROCpop(openmenu%,mlist%):ELSEPROCnomenu 10040ENDIF 10050ENDIF 10060ENDPROC 10070 10080DEFPROCm_npad 10090CASE!mlist%OF 10100WHEN0:PROCstop(17,fi$+FNfilename,rl$+"clear notepad ?") 10110ENDCASE 10120ENDPROC 10130 10140DEFPROCm_main 10150CASE!mlist%OF 10160WHEN0:PROCdialogue(w_info%) 10170WHEN1:PROCtransfer 10180WHEN2:PROCfastsort 10190WHEN3:PROCcreate 10200WHEN4:PROCstatus 10210WHEN5:PROCpdriver 10220WHEN6:IFFNv_(1)=0:PROCquit(FALSE):ELSEPROCqquit 10230ENDCASE 10240ENDPROC 10250 10260DEFPROCm_card 10270CASE!mlist%OF 10280WHEN0:PROCm_file 10290WHEN1:PROCm_wind 10300ENDCASE 10310ENDPROC 10320 10330DEFPROCm_wind 10340LOCALT%:T%=mlist%!4 10350IFT%>-1ANDT%<maxw%-1:IFw%(T%+1)>0:PROCclosew(w%(T%+1)):ENDPROC 10360CASET%OF 10370WHEN0:PROCsubs 10380WHEN1:PROCfieldlist 10390WHEN2:PROCsortw 10400WHEN3:PROCnotepad 10410WHEN4:PROCwtidy 10420ENDCASE 10430ENDPROC 10440 10450DEFPROCm_file 10460CASEmlist%!4OF 10470WHEN0:PROCCLOSE:PROCmstore("2:"+fn$,"MultiStore") 10480ENDCASE 10490ENDPROC 10500 10510DEFPROCsubmenu(menu%,X%,Y%,q%) 10520LOCALI% 10530I%=0:REPEATmlist%!I%=q%!I%:I%+=4:UNTILq%!(I%-4)=-1 10540PROCprep(openmenu%,mlist%) 10550SYS"Wimp_CreateSubMenu",,menu%,X%,Y% 10560ENDPROC 10570 10580DEFPROCclearts(mh%):LOCALI%:I%=mh%+28 10590IFmh%<menustart%ORmh%>menuend%:ENDPROC 10600REPEAT 10610!I%=!I%ANDNOT1:I%!8=I%!8ANDNOT&400000: 10620I%+=24:UNTILI%!-24AND&80 10630ENDPROC 10640 10650DEFPROCshade(mh%,I%) 10660mh%!(28+8+24*I%)=mh%!(28+8+24*I%)OR&400000:ENDPROC 10670 10680DEFPROCtick(mh%,I%) 10690mh%!(28+24*I%)=mh%!(28+24*I%)OR&01:ENDPROC 10700 10710DEFPROCredraw(update%) 10720LOCALh%,T%:IFupdate%THEN 10730SYS"Wimp_UpdateWindow",,q% TO more% 10740ELSE 10750SYS"Wimp_RedrawWindow",,q% TO more% 10760ENDIF 10770h%=!q%:PROCwtof(h%):PROCreadblock(q%+4) 10780WHILE more% 10790T%=FALSE:LOCALERROR:ONERRORLOCAL:T%=TRUE 10800IFT%THEN 10810IFINKEY-3:PROCrectfill(REPORT$):ELSERESTOREERROR:PROCerr(0) 10820ELSE 10830IFfile%>=0THEN 10840CASEwind%OF 10850WHEN0:PROCdrawcard 10860WHEN2:PROCdrawflist 10870WHEN3:PROCdrawsort 10880ENDCASE 10890ELSE 10900ENDIF 10910ENDIF 10920RESTOREERROR 10930!q%=h%:more%=FNnextrectangle 10940ENDWHILE 10950ENDPROC 10960 10970DEFPROCdrawcard 10980LOCALT%:IFupdate%T%=6:ELSESYSswi%,gline_%:CLG:T%=2 10990PROCgcol(0,7):PROCgcol(0,130+NOTFNflg(f_7bit%)) 11000MOVEbx%+margin%,by%-margin%:SYSswi%,wimp_%,T% 11010ENDPROC 11020 11030DEFPROCdrawflist:LOCALT%,X%,Y%,x%,y%:T%=&10000:IFupdate%T%=T%OR1 11040IFFNv_(7)=0PROCrectfill("No fields in this file"):ENDPROC 11050MOVEbx%+margin%,by%-margin%-4:SYSswi%,wimp_%,T% 11060ENDPROC 11070 11080DEFPROCdrawsort:IFupdate%CLG 11090LOCALY%,T%,d%,L%:d%=FNv_(14):L%=(gx1%-bx%-margin%)DIV16+1 11100LOCALERROR 11110ONERRORLOCAL:RESTOREERROR:SYSswi%,grec_%,0:PROCforce(w%(3)):PROCerr(0) 11120T%=(by%-gy1%-margin%-4)DIVlinegap%:Y%=by%-margin%-linegap%*T% 11130WHILEY%>=gy0%ANDT%<FNv_(17):MOVEbx%+margin%,Y% 11140PRINTFNrlin(T%+1,L%) 11150T%+=1:Y%-=linegap%:ENDWHILE:SYSswi%,grec_%,0TON% 11160ENDPROC 11170 11180DEFFNrlin(r%,L%):LOCALt$,a$ 11190a$=STRING$(12," "):SYSswi%,grec_%,r%TON% 11200PROCsd35:a$=RIGHT$(a$+STR$(r%),10)+": ":CASEG%OF 11210WHEN1:PROCgcol(0,3):t$="(Not in this subset)" 11220WHEN0:PROCgcol(0,7):IFL%>11:t$=FNrlin1 11230OTHERWISE:PROCgcol(0,3):t$="(Deleted Card)" 11240ENDCASE 11250=LEFT$(a$+t$,L%) 11260 11270DEFFNrlin1 11280LOCALERROR:ONERRORLOCAL:RESTOREERROR:=" ** "+REPORT$ 11290=FNev3(ox$(0),o%(0,0)AND4,o%(0,0)AND2,&90A) 11300 11310DEFFNnextrectangle:LOCALT%:SYS"Wimp_GetRectangle",,q%TOT% 11320PROCreadblock(q%+4):=T% 11330 11340DEFPROCrectfill(T$) 11350PROCgcol(0,3):LOCALI%,J%,L%,X%,Y% 11360L%=LENT$*16+48 11370X%=bx%+margin%:J%=gx0%-X%:X%=X%-J%+J%MODL% 11380J%=by%-gy1%-margin%:J%=J%-J%MODlinegap%:Y%=by%-margin%-4-J% 11390FORJ%=Y%TOgy0%STEP-linegap% 11400MOVEX%,J%:FORI%=X%TOgx1%STEPL%:PRINTT$" - ";:NEXT 11410NEXT:ENDPROC 11420 11430DEFPROCwaitpoint 11440waiter%+=1 11450SYS"Hourglass_On" 11460ENDPROC 11470 11480DEFPROCnormpoint 11490WHILEwaiter%>0:SYS"Hourglass_Off":waiter%-=1:ENDWHILE:waiter%=0 11500ENDPROC 11510 11520DEFPROCgcol(m%,c%) 11530SYS"Wimp_SetColour",(m%<<4)+c% 11540ENDPROC 11550 11560DEFPROCdataloadack 11570!q%=20:q%!12=ref%:q%!16=4 11580SYS"Wimp_SendMessage",17,q%,task% 11590ENDPROC 11600 11610DEFPROCdatasaveack 11620IFFNArfVar("Wimp$Scrap")="":ERROR99,"<Wimp$Scrap> not defined" 11630!q%=60:q%!12=ref%:q%!16=2:q%!36=-1:$(q%+44)="<Wimp$Scrap>"+CHR$0 11640SYS"Wimp_SendMessage",17,q%,task%:ackref%=q%!8 11650ENDPROC 11660 11670DEFPROCsavereq(T$,t%,s%,r%) 11680savereason%=r%:q%!32=my%:q%!28=mx%:q%!24=mi%:q%!20=mh% 11690q%!16=1:q%!12=0:q%!36=s%:q%!40=t%:!q%=(LENT$+53)AND&FFFC 11700$(q%+44)=T$+STRING$(5,CHR$0):SYS"Wimp_SendMessage",17,q%,mh%,mi% 11710saveref%=q%!8:savetype%=t%:ENDPROC 11720 11730DEFPROCloadmess:PROCreadpointer:IFtask%<0:ENDPROC 11740$(q%+44)=file$+CHR$0:!q%=(LENfile$+49)AND&FFFC 11750q%!12=ref%:q%!16=3:q%!40=savetype% 11760q%!20=mh%:q%!24=mi%:q%!28=mx%:q%!32=my%:q%!36=FNfsize(file$) 11770SYS"Wimp_SendMessage",17,q%,task% 11780ackpending%=TRUE:ENDPROC 11790 11800DEFFNfsize(T$):LOCALT%,s%:T%=OPENINT$:IFT%=0:=0 11810s%=EXT#T%:CLOSE#T%:=s% 11820 11830DEFFNzts(T%):LOCALT$ 11840WHILE?T%<>0:T$+=CHR$?T%:T%+=1:ENDWHILE 11850=T$ 11860 11870DEFPROCkey(h%,icon%,x%,y%,carh%,off%,key%) 11880LOCALF%:F%=TRUE 11890CASEkey%OF 11900WHEN9,&18A:PROCfindct 11910WHEN13:PROCcursor(h%,icon%,1,0) 11920WHEN19:PROCswapcase 11930WHEN27:IFdialogue%>=0PROCnodial:ELSEF%=FALSE 11940WHEN&181:IFNOTFNprod:PROCquit(TRUE) 11950WHEN&18F:PROCcursor(h%,icon%,-1,off%) 11960WHEN&18E:PROCcursor(h%,icon%,1,off%) 11970WHEN&19F:PROCcursor(h%,icon%,-5,off%) 11980WHEN&19E:PROCcursor(h%,icon%,5,off%) 11990WHEN&1AF,30:PROCcursor(h%,icon%,-1E9,off%) 12000WHEN&1AE:PROCcursor(h%,icon%,1E9,off%) 12010OTHERWISEF%=FALSE 12020ENDCASE 12030IFF%:ENDPROC 12040SYS"Wimp_ProcessKey",key% 12050ENDPROC 12060 12070DEFPROCswapcase:PROCgetct:T%=q%!20+FNia(!q%,q%!4) 12080IF?T%<123AND?T%>96 ?T%-=32:ELSEIF?T%<91AND?T%>64 ?T%+=32 12090PROCgetct:IF?T%>31PROCsetct(!q%,q%!4,q%!20+1) 12100PROCgetct:PROCiconupd(!q%,q%!4):ENDPROC 12110 12120DEFPROCgetct:SYS"Wimp_GetCaretPosition",,q%:ENDPROC 12130 12140DEFPROCsetct(h%,i%,o%):SYS"Wimp_SetCaretPosition",h%,i%,,,-1,o% 12150IFi%>=0PROCfindct 12160ENDPROC 12170 12180DEFPROCcursor(h%,i%,s%,o%) 12190RESTORE12380 12200LOCALW%,T$,I% 12210WHILEW%<>-1 12220PROCreadh(W%):IFW%<>h%THEN 12230IFW%<>-1:REPEAT:READW%:UNTILW%<-1:W%=0 12240ELSE 12250REPEAT 12260READW%:IFW%<>-1:T$+=CHR$(W%) 12270UNTILW%<-1:T$=LEFT$(T$) 12280IFkey%=13:IFASCRIGHT$(T$)=i%:mi%=ABS(W%+100):mb%=1:mh%=h%:PROCselect:ENDPROC 12290IFs%=1E9:s%=LENT$:ELSEIFs%=-1E9:s%=1:ELSEs%+=INSTR(T$,CHR$i%) 12300WHILEs%>LENT$:s%-=LENT$:ENDWHILE 12310WHILEs%<1:s%+=LENT$:ENDWHILE 12320I%=ASCMID$(T$,s%) 12330IFo%>LEN$FNia(h%,I%)o%=LEN$FNia(h%,I%) 12340PROCsetct(h%,I%,o%) 12350ENDIF 12360ENDWHILE 12370ENDPROC 12380DATAw_save%,2,-100 12390DATAw_open%,14,-112 12400DATAw_sortex%,17,-123 12410DATA"w%(4)",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,-100 12420DATA-1 12430 12440DEFFNleaf(T$) 12450LOCALI%,C% 12460IF((INSTR(T$,".")=0)AND(INSTR(T$,":")=0))THEN=T$ 12470I%=LEN(T$) 12480REPEAT 12490C%=ASCMID$(T$,I%,1) 12500I%-=1 12510UNTIL(I%<=0ORC%=ASC"."ORC%=ASC":") 12520IFI%>0THEN=RIGHT$(T$,LEN(T$)-I%-1) 12530=T$ 12540 12550DEFPROCwext(h%,x%,y%):!q%=0:q%!4=-y%:q%!8=x%:q%!12=0 12560SYS"Wimp_SetExtent",h%,q%:PROCforce(h%) 12570PROCgetw(h%):IFopen%THEN 12580IFx1%-x0%>x%:x%+=x0%:ELSEx%=x1% 12590IFy1%-y0%>y%:y%=y1%-y%:ELSEy%=y0% 12600PROCopen(h%,x0%,y%,x%,y1%,scx%,scy%,bhandle%) 12610ENDIF 12620ENDPROC 12630 12640DEFPROCprocess 12650IFdialreason%>=0ORdialogue%>=0ORackpending%>0ENDPROC 12660CASEprocess%OF 12670WHEN1:PROCcheckprot 12680WHEN2:PROCstop(1,"Please place original","MultiStore disk in drive :0"):process%+=1 12690WHEN3:PROCcheckprot 12700WHEN4:PROCfastsort:PROCstartopen 12710OTHERWISEprocess%=0 12720ENDCASE 12730PROCnewdelay 12740ENDPROC 12750 12760DEFPROCdragicon(h%,i%) 12770LOCALx%,y%,ys%,tx0%,ty0%,tx1%,ty1% 12780PROCgetw(h%):ys%=y1%-y0%:x%=bx%:y%=y0%-scy% 12790PROCgeti(h%,i%):q%!8+=x%:q%!12+=y%+ys%:q%!16+=x% 12800q%!20+=y%+ys%:q%!24=0:q%!28=0:!q%=0:PROCdrag5:ENDPROC 12810 12820DEFPROCdrag5:PROCreadpointer:PROCscrsz:tx0%=mx%-q%!8:ty0%=my%-q%!12 12830q%!24-=tx0%:q%!28-=ty0%:q%!32+=q%!16-mx%:q%!36+=q%!20-my% 12840q%!4=5:SYS"Wimp_DragBox",,q%:ENDPROC 12850 12860DEFFNlower(T$):IFT$="":="" 12870LOCALI%,C% 12880FORI%=1TOLENT$:C%=ASCMID$(T$,I%) 12890IFC%>64ANDC%<91MID$(T$,I%,1)=CHR$(C%+32) 12900NEXT:=T$ 12910 12920DEFPROCwtof(T%):LOCALJ%:wind%=-1:file%=-1 12930FORJ%=0TOmaxw%:IFw%(J%)=T%:file%=0:wind%=J%:ENDPROC 12940NEXT:ENDPROC 12950 12960DEFPROCfext 12970LOCALx%,y% 12980y%=FNht*linegap%+margin%*2 12990x%=FNwd*16+margin%*2:IFx%<22*16x%=22*16 13000!q%=0:q%!4=-y%:q%!8=x%:q%!12=0:SYS"Wimp_SetExtent",w%(0),q% 13010PROCgetw(w%(0)) 13020IFx1%-x0%>x%:x%+=x0%:ELSEx%=x1% 13030IFy1%-y0%>y%:y%=y1%-y%:ELSEy%=y0% 13040PROCopen(w%(0),x0%,y%,x%,y1%,scx%,scy%,bhandle%) 13050ENDPROC 13060 13070DEFFNht:SYSswi%,sd57_%,"height"TOG% 13080DEFFNwd:SYSswi%,sd57_%,"width"TOG% 13090=G% 13100 13110DEFFNbadrec(T%):=(T%AND&7FFFFF00)=&7FFFFF00 13120 13130DEFPROCstartopen 13140T$=FNArfVar("MultiStore$Function") 13150CASEVALT$OF 13160WHEN1:PROCopensort1(MID$(T$,3),7,0,"",0) 13170ENDCASE 13180*unset MultiStore$Function 13190process%+=1:ENDPROC 13200 13210DEFPROCready 13220ENDPROC 13230 13240DEFPROCcloseok 13250PROCstop(2,"","Close file "+FNfilename) 13260ENDPROC 13270 13280DEFFNfilename 13290SYSswi%,stat_%TOG% 13300=RIGHT$(FNleaf($sd%),10) 13310 13320DEFFNhdbyte(T%):SYSswi%,sd13_%,T%TOG% 13330DEFFNhdbyte1(T%):SYSswi%,sd13_%,T%TOG% 13340=G% 13350 13360DEFPROCqbscan(T$,RETURN Q%,RETURN B%) 13370LOCALI%,T%:Q%=FALSE:B%=0:FORI%=1TOLENT$:T%=ASCMID$(T$,I%) 13380IFT%=34:Q%=NOTQ% 13390IFNOTQ%THEN 13400IFT%=ASC"(":B%+=1:ELSEIFT%=ASC")":B%-=1 13410ENDIF 13420NEXT:ENDPROC 13430 13440DEFPROCfieldlist:IFw%(2)<=0:PROCmakeflist:ENDPROC 13450PROCfront(w%(2),-1,-1):ENDPROC 13460 13470DEFPROCdelicon(h%,i%):!q%=h%:q%!4=i%:SYS"Wimp_DeleteIcon",,q%:ENDPROC 13480 13490DEFPROCloseicon(h%,i%):PROCgeti(h%,i%):PROCdelicon(h%,i%) 13500q%!4=!q%:q%!8=-1E9:q%!12=-1E9:q%!16=-1E9:q%!20=-1E9 13510SYS"Wimp_CreateIcon",,q%+4:ENDPROC 13520 13530DEFPROCcarddr 13540PROCwtof(mh%):IFfile%>=0THEN 13550CASEwind%OF 13560ENDCASE 13570ELSE 13580CASEmh%OF 13590OTHERWISE:PROCsavereq("Card",&FFF,FNwd*FNht,1) 13600ENDCASE 13610ENDIF 13620ENDPROC 13630 13640DEFPROCcarddr1 13650tx0%=!q%:tx1%=q%!8:ty0%=q%!4:ty1%=q%!12 13660IFABS(tx0%-tx1%)<10ANDABS(ty0%-ty1%)<10:mb%=1:PROCselect:ENDPROC 13670PROCcxconv(tx0%):PROCcxconv(tx1%):PROCcyconv(ty0%):PROCcyconv(ty1%) 13680IFtx0%>tx1%:SWAPtx0%,tx1% 13690IFty0%>ty1%:SWAPty0%,ty1% 13700PROCsavew(f_cd$,&FFF,2,(tx1%-tx0%+1)*(ty1%-ty0%+1)) 13710ENDPROC 13720 13730DEFPROCfielddr:LOCALX%,Y% 13740PROCwtof(mh%):IFfile%>=0THEN 13750CASEwind%OF 13760WHEN3:PROCmsortw:PROCseti(w_sortex%,17,FNfname1(menufield%)) 13770OTHERWISE:IFFNenterfield 13780ENDCASE 13790ELSE 13800IFFNenterfield 13810ENDIF 13820ENDPROC 13830 13840DEFPROCsavedata:IFq%!12<>saveref%:ENDPROC 13850file$=FNzts(q%+44) 13860PROCsavedata1:ENDPROC 13870 13880DEFPROCsavedata1:PROCclosew(w_save%) 13890outfile%=0:outfile%=OPENOUTfile$:IFoutfile%=0:ENDPROC 13900LOCALERROR 13910ONERRORLOCAL:RESTOREERROR:CLOSE#outfile%:PROCerr(0) 13920CASEsavereason%OF 13930WHEN5:PROCsavenotes 13940ENDCASE 13950RESTOREERROR:CLOSE#outfile% 13960OSCLI"settype "+file$+" "+STR$~savetype%:PROCloadmess 13970savereason%=-1:PROCnomenu 13980ENDPROC 13990 14000DEFFNmousef 14010LOCALX%,Y%:X%=mx%:Y%=my%:PROCcyconv(Y%):PROCcxconv(X%) 14020LOCALERROR:ONERRORLOCAL:=0 14030SYSswi%,sd52_%,X%,Y%TOG% 14040=G% 14050 14060DEFPROCdragfield:PROCfieldsz(menufield%) 14070!q%=w%(0):q%!8=bx%+tx0%:q%!12=by%+ty0%:q%!16=bx%+tx1% 14080q%!20=by%+ty1%:q%!24=0:q%!28=0:q%!4=5:PROCdrag5:ENDPROC 14090 14100DEFPROCdragfield1:LOCALY% 14110PROCgetw(w%(2)):Y%=by%-menufield%*linegap%-margin%+linegap% 14120q%!8=bx%+margin%:!q%=w%(2):q%!12=Y%-32:q%!16=bx%+ex1%-margin% 14130q%!20=Y%:q%!24=0:q%!28=0:q%!4=5:PROCdrag5:ENDPROC 14140 14150DEFPROCdragcard:IFFNdialogue:ENDPROC 14160!q%=w%(0):PROCgetw(!q%) 14170q%!8=mx%:q%!12=my%:q%!16=mx%:q%!20=my% 14180q%!24=bx%+ex0%+margin%:q%!28=by%+ey1%-margin%-FNht*linegap% 14190q%!32=bx%+ex0%+margin%+FNwd*16 14200q%!36=by%+ey1%-margin%:q%!4=6:SYS"Wimp_DragBox",,q% 14210ENDPROC 14220 14230DEFPROCcxconv(RETURN X%):PROCxconv(X%,FNwd,w%(0)):ENDPROC 14240DEFPROCcyconv(RETURN Y%):PROCyconv(Y%,FNht,w%(0)):ENDPROC 14250 14260DEFPROCyconv(RETURN Y%,T%,h%):PROCgetw(h%) 14270Y%=(by%-Y%-margin%)DIVlinegap%+1:IFY%<1Y%=1ELSEIFY%>T%Y%=T% 14280ENDPROC 14290 14300DEFPROCxconv(RETURN X%,T%,h%):PROCgetw(h%) 14310X%=(X%-bx%-margin%)DIV16+1:IFX%<1X%=1ELSEIFX%>T%X%=T% 14320ENDPROC 14330 14340DEFPROCsavew(f$,T%,r%,s%) 14350PROCsaveset(f$,T%,r%,s%) 14360PROCdialogue(w_save%):ENDPROC 14370 14380DEFPROCsaveset(f$,T%,r%,s%) 14390savereason%=r%:savet%=T%:saves%=s% 14400PROCseti(w_save%,2,f$):$FNva(w_save%,3)="sfile_"+RIGHT$("00"+STR$~T%,3) 14410ENDPROC 14420 14430DEFPROCCLOSE 14440IFFNv_(1)>0:closeok%=TRUE:PROCclosefile 14450ENDPROC 14460 14470DEFPROCprequit 14480IFFNv_(1)>0PROCackrec:PROCqquit 14490ENDPROC 14500 14510DEFPROCackrec:q%!12=ref%:SYS"Wimp_SendMessage",19,q%,task% 14520DEFPROCqquit:PROCstop(6,"Close files and quit",as$) 14530ENDPROC 14540 14550DEFFNfname(T%):SYSswi%,sd17_%,9,T%TOG% 14560=$sd% 14570 14580DEFFNfname1(T%):IFT%<0:="N%":ELSESYSswi%,sd17_%,4,T%TOG% 14590IF(G%AND7)=7:="@"+FNfname(T%):ELSE="#"+FNfname(T%) 14600 14610DEFPROCass:LOCALL%,I%,A%:DIML%50:FORI%=0TO1:P%=L%:[opt I%*2:.search%:mov 5,#&FF:add 5,5,#&FF00:and 2,2,5:mul 9,0,3:sub 3,3,#1:add 8,1,9:.A%:ldrb 4,[8],#1:ldrb 9,[8],3:orr 4,4,9,asl #8:cmp 4,2:add 0,0,#1:bne A%:mov 15,14:]:NEXT:ENDPROC 14620 14630DEFPROCflg(T%,F%):flg%=(flg%ANDNOTT%)OR((F%<>0)ANDT%):ENDPROC 14640DEFFNflg(T%)=(flg%ANDT%)<>0 14650 14660DEFFNx1(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(306) 14670=FNx(T$) 14680 14690DEFFNx(A$):PROCstrip(A$):IFA$="":PROCerr(35) 14700LOCALQ%,B%,I%,z$:PROCqbscan(A$,Q%,B%):IFQ%PROCerr(10):ELSEIFB%PROCerr(11) 14710z$=A$:WHILEINSTR(z$,"'"):I%=INSTR(z$,"'") 14720J%=(ASCMID$(z$,I%+1))AND&DF 14730IFJ%<65ORJ%>83:PROCerr(29) 14740IFLENz$+LEN$FNtia(tw%(4),J%-65)>250:PROCerr(30) 14750z$=LEFT$(z$,I%-1)+$FNtia(tw%(4),J%-65)+MID$(z$,I%+2) 14760ENDWHILE:A$=FNX(z$):PROCstrip(A$):IFA$="":PROCerr(35):ELSE=A$ 14770 14780DEFFNX(A$):LOCALz$,J%,I%:z$=A$ 14790WHILEINSTR(A$,"=""*"):I%=INSTR(A$,"=""*") 14800z$=LEFT$(A$,I%-1)+","""+MID$(A$,I%+3) 14810J%=INSTR(z$,CHR$34,I%+2):IFJ%=0:PROCerr(10) 14820IFMID$(z$,J%-1,1)="*":z$=LEFT$(z$,J%-2)+MID$(z$,J%):J%-=1 14830z$=LEFT$(z$,J%)+")"+MID$(z$,J%+1):J%=I% 14840REPEAT:I%=I%-1:IFI%<0:PROCerr(31) 14850UNTILMID$(z$,I%,1)="@" 14860z$=LEFT$(z$,I%-1)+"FNi("+MID$(z$,I%) 14870A$=z$:ENDWHILE:=A$ 14880 14890DEFFNev(A$,s%,u%) 14900$sd%="N":IFs%$sd%+="S" 14910IFu%$sd%+="U" 14920SYSswi%,expand_%,A$,$sd% 14930R%=FNv_(17):D%=FNv_(14):N%=FNv_(15) 14940=EVAL$sd% 14950 14960DEFFNev3(A$,s%,u%,A%) 14970LOCALU%:LOCALERROR 14980ONERRORLOCAL:RESTOREERROR:@%=&90A:U%=TRUE:IFERR<>6:PROCerr(0) 14990IFU%THEN 15000$sd%=FNev(A$,s%,u%) 15010ELSE 15020@%=A%:$sd%=RIGHT$(" "+STR$FNev(A$,s%,u%),15) 15030IFs%:SYSswi%,strip_% 15040ENDIF 15050@%=&90A:=$sd% 15060 15070DEFPROCwtidy 15080LOCALI%:FORI%=2TOmaxw%:IFw%(I%)>0PROCclosew(w%(I%)) 15090NEXT:ENDPROC 15100 15110DEFPROCscrollto(X%,Y%,h%):IFh%<0ENDPROC:ELSEPROCgetw(h%) 15120IFX%>=x0%-bx%ANDX%<=x1%-bx%ANDY%<=y1%-by%-32ANDY%>=y0%-by%ENDPROC 15130scx%=X%-(x1%-x0%)DIV2:scy%=ABSY%-(y1%-y0%)DIV2 15140IFscx%<0scx%=0 15150IFscy%<0scy%=0 15160PROCopen(h%,x0%,y0%,x1%,y1%,scx%,-scy%,bhandle%) 15170ENDPROC 15180 15190DEFPROCfindct:PROCgetct:PROCscrollto(q%!8,q%!12,!q%):ENDPROC 15200 15210DEFPROCstatus:w_status%=FNcrwind(tw_status%) 15220LOCALI%,T%,T$,s$:s$=STRING$(12," ") 15230PROCunselall(w_status%):T%=0 15240IFFNv_(1)>0THEN 15250T$=LEFT$(FNfilename+STRING$(11," "),11) 15260T$+=RIGHT$(s$+STR$FNv_(16),10)+RIGHT$(s$+STR$FNv_(17),11)+" (SORT)" 15270IFT%<8:PROCseti(w_status%,T%+15,T$):T%+=1 15280ENDIF 15290WHILET%<8:PROCseti(w_status%,T%+15,""):T%+=1:ENDWHILE 15300IFstopboxes%:PROCseli(w_status%,23) 15310IFsound%:PROCseli(w_status%,24) 15320IFshadows%:PROCseli(w_status%,25) 15330IFpix%:PROCseli(w_status%,28) 15340IFsprsz%<=0:PROCshadei(w_status%,28) 15350PROCdialogue(w_status%):ENDPROC 15360 15370DEFPROCremove(RETURN T$,t$):LOCALI% 15380REPEATI%=INSTR(T$,t$):IFI%:T$=LEFT$(T$,I%-1)+MID$(T$,I%+1) 15390UNTILI%=0:ENDPROC 15400 15410DEFPROCoscli(T$):IFASCT$=42:OSCLIT$:ENDPROC 15420LOCALI%,J%:SYS"Wimp_CommandWindow",1 15430PROCnormpoint:mode%=MODE:MODE12 15440*fx229 15450IFT$=""THEN 15460PROCnovars 15470LOCALERROR 15480ONERRORLOCALIFERR=17ANDT$="":PROCendoscli:ENDPROC:ELSEREPORT:PRINT 15490REPEATT$="":INPUTLINE"*"T$ 15500CASE TRUE OF 15510WHEN ASCT$=63ANDFNv_(1)=0:PRINTEVAL(MID$(T$,2)) 15520WHEN ASCT$=63ANDFNv_(1)>0:PRINTFNev(MID$(T$,2),0,0) 15530OTHERWISEOSCLIT$ 15540ENDCASE 15550UNTILT$="" 15560RESTOREERROR 15570ELSE 15580LOCALERROR 15590ONERRORLOCAL:RESTOREERROR:PROCendoscli:PROCerr(0) 15600TIME=0:OSCLIT$:SYS"OS_Byte",&86TO,I%,J% 15610IFTIME<150ANDI%+J%<>0REPEATUNTILINKEY0<0:PRINT''"Press a key... ";:IFGET 15620ENDIF 15630PROCendoscli:ENDPROC 15640 15650DEFPROCendoscli:*fx229,1 15660SYS"Wimp_CommandWindow",-1 15670SYS"Wimp_SetMode",mode%:OFF:PROCforce(-1) 15680PROCsdvars:ENDPROC 15690 15700DEFFNshowbranch:PROCreadpointer:IFmb%<>1ORmi%<>-3:=FALSE 15710LOCALT$,t$:T$=fn$::t$=FNleaf(T$):IFt$=T$:=TRUE 15720OSCLI"*filer_opendir "+LEFT$(T$,LENT$-LENt$-1):=TRUE 15730 15740DEFPROCnewfn(RETURN T$):IFFNu(file$)<>"<WIMP$SCRAP>"T$=file$ 15750ENDPROC 15760 15770DEFPROCreadparams:LOCALI%,F%,T$ 15780maxf%=3:maxacr%=4:maxcol%=29:avchar%=65:ctchar%=67:manual%=FALSE 15790stopboxes%=TRUE:sound%=TRUE:shadows%=TRUE:tools%=TRUE:pix%=FALSE 15800clearpass%=TRUE 15810sprsz%=0:dplen%=66:dpwid%=79:picpath$="<MultiStore$Dir>.^.Pictures." 15820f_pd$="PDriver":f_la$="LabelSet":f_wp$="WordSet":f_rp$="ReportSet" 15830f_np$="Notepad":f_mc$="Macro":f_rx$="Report":f_cd$="Card" 15840F%=OPENIN(FNdir+"Params") 15850IFF%:WHILENOTEOF#F%:PROCreadparam(GET$#F%):ENDWHILE:CLOSE#F% 15860IFsprsz%<=50sprsz%=0 15870PROCreadflags:ENDPROC 15880 15890DEFPROCreadparam(T$) 15900T$=FNs1(T$):IFT$=""ORASCT$=ASC";"ENDPROC 15910LOCALV$,T%,on,off:on=TRUE:T%=INSTR(T$," "):IFT%=0ENDPROC 15920V$=MID$(T$,T%):T$=LEFT$(T$,T%-1):V$=FNs1(V$) 15930T%=INSTR(V$,";"):IFT%V$=LEFT$(V$,T%-1) 15940LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 15950CASEFNlower(T$)OF 15960WHEN"shadow":shadows%=EVALV$ 15970WHEN"stopboxes":stopboxes%=EVALV$ 15980WHEN"sound":sound%=EVALV$ 15990WHEN"tools":tools%=EVALV$ 16000WHEN"fnnotepad":f_np$=V$ 16010WHEN"fnmacro":f_mc$=V$ 16020WHEN"fnreport":f_rx$=V$ 16030WHEN"fncard":f_cd$=V$ 16040WHEN"clearpass":clearpass%=EVALV$ 16050WHEN"pagelen":dplen%=EVALV$ 16060WHEN"pagewid":dpwid%=EVALV$ 16070WHEN"pictures":sprsz%=EVALV$ 16080WHEN"labels":maxacr%=EVALV$ 16090WHEN"columns":maxcol%=EVALV$-1 16100WHEN"files":maxf%=EVALV$-1 16110WHEN"average":avchar%=ASCV$:IFavchar%<32ORavchar%=127avchar%=65 16120WHEN"count":ctchar%=ASCV$:IFctchar%<32ORctchar%=127ctchar%=67 16130WHEN"manual":manual%=EVALV$ 16140WHEN"picpath":picpath$=V$ 16150ENDCASE:ENDPROC 16160 16170DEFFNs1(T$):WHILEASCT$=32:T$=MID$(T$,2):ENDWHILE 16180WHILERIGHT$(T$)=" ":T$=LEFT$(T$):ENDWHILE:=T$ 16190 16200DEFPROCupplit(RETURN A$):LOCALQ%,I%,C%:IFA$="":ENDPROC 16210FORI%=1TOLENA$:C%=ASCMID$(A$,I%):IFC%=34Q%=NOTQ% 16220IFQ%ANDC%>96ANDC%<123MID$(A$,I%,1)=CHR$(C%-32) 16230NEXT:ENDPROC 16240 16250DEFPROCmstore(A$,T$):LOCALT%,B% 16260LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(60) 16270T$=FNdir+T$:T%=OPENIN(T$):IFT%=0PROCerr(59) 16280B%=BGET#T%:CLOSE#T%:IFFNs(A$)>"":OSCLI"*Set MultiStore$Function "+A$ 16290PROCwriteflags:RESTOREERROR 16300ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 16310PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 16320PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 16330IFw_sort%>0PROCdelw(w_sort%) 16340PROCnormpoint 16350Z%=taskhandle%:PROCnovars:CHAIN(T$):END 16360 16370DEFPROCpdriver:IFFNv_(1)>0PROCerr(103) 16380PROCmstore("1","MultiStore"):ENDPROC 16390 16400DEFPROCnewdelay 16410IFprocess%>0ORstartsort%ORsbfile%>=0delay%=0ELSEdelay%=2E9 16420ENDPROC 16430 16440DEFPROCfieldsz1(T%):LOCALgx0%,gy0%,gx1%,gy1% 16450DEFPROCfieldsz(T%) 16460LOCALL%,X%,Y%,G%,t% 16470PROCgetw(w%(0)):SYSswi%,sd17_%,1,T%TOL% 16480SYSswi%,sd17_%,2,T%TOX% 16490SYSswi%,sd17_%,3,T%TOY% 16500SYS"OS_ReadModeVariable",-1,5TO,,T% 16510ty0%=(-Y%*linegap%-margin%)ANDNOT((1<<T%)-1) 16520tx0%=X%*16+margin%-16:ty1%=ty0%+linegap%:tx1%=tx0%+L%*16+2 16530ENDPROC 16540 16550DEFPROCcheckconv(T$):LOCALT%,B% 16560LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#T%:ENDPROC 16570file$=T$:T%=OPENIN(file$):IFT%=0:ENDPROC 16580B%=BGET#T%:IFB%<>234ANDB%<>235:CLOSE#T%:ENDPROC 16590B%=BGET#T%+BGET#T%+BGET#T%+BGET#T%:CLOSE#T% 16600RESTOREERROR 16610IFB%=0B%=ft_form%ELSEB%=ft_data% 16620menufield%=B%:PROCstop(36,"Wrong file type","Convert to MultiStore ?") 16630ENDPROC 16640 16650DEFPROCtransfer:LOCALT$ 16660IFFNv_(1)>0T$=fn$:PROCclosefile(TRUE) 16670PROCmstore("1:"+T$,"MSTransfer") 16680 16690DEFPROCwriteflags:LOCALT$ 16700T$=FNflgstr(sound%)+FNflgstr(stopboxes%)+FNflgstr(shadows%)+FNflgstr(pix%) 16710OSCLI"*Set MultiStore$Flags "+T$:ENDPROC 16720 16730DEFFNflgstr(T%):IFT%:="*":ELSE="-" 16740 16750DEFPROCstrflg(T$,RETURN T%) 16760IFT$="*":T%=TRUE:ELSEIFT$="-"T%=FALSE 16770ENDPROC 16780 16790DEFPROCreadflags:LOCALT$:T$=FNArfVar("MultiStore$Flags") 16800PROCstrflg(LEFT$(T$,1),sound%):PROCstrflg(MID$(T$,2,1),stopboxes%) 16810PROCstrflg(MID$(T$,3,1),shadows%):PROCstrflg(MID$(T$,4,1),pix%) 16820*unset MultiStore$Flags 16830ENDPROC 16840 16850DEFPROCcheckopen:IFFNv_(1)=0:ENDPROC 16860PROCerr(301) 16870 16880DEFPROCfastsort 16890IFw_sort%<0w_sort%=FNcrwind(tw_sort%) 16900PROCfront(w_sort%,-1,-1) 16910IFFNv_(1)=0THEN 16920PROCseti(w_sort%,2,"(NOT OPEN)") 16930PROCseti(w_sort%,6,"No file open") 16940ELSE 16950PROCseti(w_sort%,2,FNfilename) 16960PROCseti(w_sort%,6,"Defining sort") 16970ENDIF 16980ENDPROC 16990 17000DEFPROCcreate:LOCALT%,B%,T$:IFFNv_(1)>0PROCerr(305) 17010LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(60) 17020T$=FNdir+"MSCreate":T%=OPENIN(T$):IFT%=0PROCerr(59) 17030B%=BGET#T%:CLOSE#T%:PROCwriteflags:RESTOREERROR 17040ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 17050PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 17060PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 17070IFw_sort%>0PROCdelw(w_sort%) 17080PROCnormpoint:*Set MultiStore$Function 1 17090Z%=taskhandle%:PROCnovars:CHAIN(T$):END 17100 17110DEFPROCshadeopen:LOCALI% 17120FORI%=0TO8:PROCshadei(w_open%,I%):NEXT 17130PROCshadei(w_open%,16) 17140ENDPROC 17150 17160DEFFNpwcode(T$):IFT$="":="" 17170LOCALA%,B%,I%:FORI%=1TOLENT$ 17180MID$(T$,I%,1)=CHR$(ASCMID$(T$,I%)EOR(I%+173)) 17190NEXT:=T$ 17200 17210DEFPROCreadws:LOCALT$,T%,I%,c% 17220c%=FNhdbyte1(53):IFc%<>id_bbc%ANDc%<>id_wcia%ANDc%<>id_exb%:ENDPROC 17230SYSswi%,sd24_% 17240IFc%=id_exb%PROCreadexbws:ENDPROC 17250r$(0)=FNgs:FORI%=0TO18:PROCnote(I%,LEFT$(FNgs,69)):NEXT 17260e$(0)=LEFT$(FNgs,70) 17270PROCflg(f_rspc%,FNgb):PROCflg(f_rupp%,FNgb) 17280PROCflg(f_sspc%,FNgb2):PROCflg(f_supp%,FNgb2) 17290T%=FNv_(7)+5:IFT%>30ORc%=id_wcia%T%=30 17300FORI%=0TOT%:ma$(I%)=FNgs:NEXT 17310SYSswi%,sd25_%TOG% 17320IFG%=11:PROCflg(f_macb%,TRUE):ELSEIFG%:PROCflg(f_mace%,TRUE) 17330ENDPROC 17340 17350DEFPROCreadexbws:LOCALI%,T% 17360FORI%=0TO18:PROCnote(I%,FNgs):NEXT 17370FORI%=0TO29:ma$(I%)=FNgs:NEXT 17380FORI%=0TO23:d$(0,I%)=FNgs:NEXT:f$(0)=FNgs:fx$(0)=FNgs 17390e$(0)=FNgs:FORI%=0TO14:w$(0,I%)=FNgs:NEXT:wo%(0)=FNgw(0) 17400r%(0)=FNgw(0) 17410fl%(0)=(fl%(0)ANDNOTf_save%)OR(FNgw(f_dflt%)ANDf_save%) 17420FORI%=0TO3:t%(0,I%)=FNgw(0):NEXT:o$(0)=FNgs:o%(0,0)=FNgw(0)OR4 17430r$(0)=FNgs:sr$(0)=FNgs:l$(0)=FNgs:lk$(0)=FNgs 17440lx$(0)=FNgs 17450FORI%=0TO5:ll%(0,I%)=FNgw(0):NEXT 17460FORI%=0TO15:lf%(0,I%)=FNgw(0):NEXT 17470FORI%=0TO4:p%(0,I%)=FNgw(0):NEXT:FORI%=0TO7:p$(0,I%)=FNgs:NEXT 17480T%=FNgw(0):FORI%=0TOT% 17490IFI%<=maxcol%THEN 17500c$(file%,I%,0)=FNgs:c$(file%,I%,1)=FNgs:c%(file%,I%)=FNgw(0) 17510ELSE 17520$sd%=FNgs:$sd%=FNgs:!sd%=FNgw(0) 17530ENDIF 17540NEXT 17550st%(file%,0)=VALFNgs:st%(file%,1)=VALFNgs:st%(file%,2)=TIME/100 17560ENDPROC 17570 17580DEFPROCwritews 17590LOCALT$,I%,c% 17600c%=FNhdbyte(&35):IFc%<>id_bbc%ANDc%<>id_wcia%ANDc%<>id_exb%:ENDPROC 17610SYSswi%,sd24_% 17620IFc%=id_exb%:PROCwriteexbws:ENDPROC 17630$sd%=r$(0):SYSswi%,sd28_% 17640FORI%=0TO18:$sd%=FNnote(I%):SYSswi%,sd28_%:NEXT:$sd%=e$(0):SYSswi%,sd28_% 17650PROCwsb(FNflg(f_rspc%)):PROCwsb(FNflg(f_rupp%)) 17660PROCwsb(FNflg(f_sspc%)):PROCwsb(FNflg(f_supp%)) 17670T%=FNv_(7)+5:IFT%>30ORc%=id_wcia%T%=30 17680FORI%=0TOT%:$sd%=ma$(I%):SYSswi%,sd28_%:NEXT 17690T%=0:IFFNflg(f_mace%):T%=1:ELSEIFFNflg(f_macb%):T%=11 17700SYSswi%,sd26_%,T% 17710ENDPROC 17720 17730DEFPROCwriteexbws:LOCALI% 17740FORI%=0TO18:PROCws(FNnote(I%)):NEXT 17750FORI%=0TO29:PROCws(ma$(I%)):NEXT 17760FORI%=0TO23:PROCws(d$(0,I%)):NEXT:PROCws(f$(0)):PROCws(fx$(0)) 17770PROCws(e$(0)):FORI%=0TO14:PROCws(w$(0,I%)):NEXT 17780PROCwsw(wo%(0)):PROCwsw(r%(0)):PROCwsw(fl%(0)) 17790FORI%=0TO3:PROCwsw(t%(0,I%)):NEXT:PROCws(o$(0)) 17800PROCwsw(o%(0,0)):PROCws(r$(0)):PROCws(sr$(0)) 17810PROCws(l$(0)):PROCws(lk$(0)):PROCws(lx$(0)) 17820FORI%=0TO5:PROCwsw(ll%(0,I%)):NEXT 17830FORI%=0TO15:PROCwsw(lf%(0,I%)):NEXT 17840FORI%=0TO4:PROCwsw(p%(0,I%)):NEXT:FORI%=0TO7:PROCws(p$(0,I%)):NEXT 17850PROCwsw(maxcol%):FORI%=0TOmaxcol% 17860PROCws(c$(file%,I%,0)):PROCws(c$(file%,I%,1)):PROCwsw(c%(file%,I%)) 17870NEXT:st%(file%,1)+=TIME/100-st%(file%,2):st%(file%,2)=TIME/100 17880st%(file%,0)+=1:PROCws(STR$st%(file%,0)):PROCws(STR$st%(file%,1)) 17890ENDPROC 17900 17910DEFFNgb:SYSswi%,sd25_%TOG%:=(G%=11) 17920DEFFNgb2:SYSswi%,sd25_%TOG%:=(G%<>0) 17930DEFFNgs:SYSswi%,sd27_%:=$sd% 17940DEFPROCws(T$):$sd%=T$:SYSswi%,sd28_% 17950DEFPROCwsb(T%):IFT%SYSswi%,sd26_%,11:ELSESYSswi%,sd26_%,0 17960ENDPROC 17970 17980DEFFNgw(A%):LOCALT%,I%:FORI%=0TO3:SYSswi%,sd25_%TOG% 17990T%=T%OR((G%AND255)<<(I%*8)):NEXT:IFT%=&0d0d0d0dT%=A% 18000=T% 18010 18020DEFPROCwsw(T%):LOCALI%:FORI%=0TO3:G%=T%AND255:SYSswi%,sd26_%,G% 18030T%=(T%>>8):NEXT:ENDPROC 18040 18050DEFFNnote(I%):LOCALq%:q%=workbuf%:=$FNtia(tw%(4),I%) 18060 18070DEFPROCnote(I%,T$):LOCALq%:q%=workbuf% 18080IFw%(4)>0PROCseti(w%(4),I%,T$)ELSE$FNtia(tw%(4),I%)=LEFT$(T$,80) 18090ENDPROC 18100 18110DEFPROCloadnotes:LOCALI%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 18120WHILENOTEOF#T%ANDI%<19:PROCnote(I%,GET$#T%) 18130I%+=1:ENDWHILE:CLOSE#T%:WHILEI%<19:PROCnote(I%,""):I%+=1:ENDWHILE 18140PROCnoscrap:PROCnewfn(f_np$):ENDPROC 18150 18160DEFFNsubstr:SYSswi%,sd53_%TOG% 18170=$(sd%+16) 18180 18190DEFFNsubname(s%):SYSswi%,sd53_%,s%TOG% 18200=$sd% 18210 18220DEFFNsubdesc1(T%) 18230IFT%=0:="All Cards" 18240IFT%>255:="Numeric: "+FNsubname(T%-256) 18250T$="":IFT%>31:T%=T%AND31:T$="NOT " 18260=T$+"Subset "+CHR$(T%+65) 18270 18280DEFFNsubdesc2(T%) 18290LOCALT$ 18300CASE TRUE OF 18310WHENT%=0ORT%=32:T$="All cards in file" 18320WHENT%>32ANDT%<64 18330T$=d$(0,T%-33) 18340IFT$="":T$=FNsubdesc1(T%):ELSEIFLENT$<21T$="NOT("+T$+")" 18350WHENT%>0ANDT%<32:T$=d$(0,T%-1):IFT$="":T$=FNsubdesc1(T%) 18360WHENT%>255:T$="Numeric subset: "+FNsubname(T%-256) 18370OTHERWISET$="" 18380ENDCASE 18390=T$ 18400 18410DEFFNsubdesc4(T%):IFT%>255:="^"+FNsubname(T%-256) 18420IFT%<31:="^"+CHR$(T%+65) 18430="(^"+CHR$(T%+33)+"=0)" 18440 18450DEFPROCptrexit(h%) 18460IFsbfile%>=0:PROCsubdisp:sbfile%=-1:PROCnewdelay 18470ENDPROC 18480 18490DEFPROCptrenter(h%) 18500PROCwtof(h%):IFfile%>=0THEN 18510IFwind%=1:sbfile%=file%:PROCsubdisp:PROCnewdelay 18520ENDIF 18530ENDPROC 18540 18550DEFPROCsubdisp1:LOCALsbfile%:sbfile%=0:PROCsubdisp:ENDPROC 18560 18570DEFPROCsubdisp:IFsbfile%<0:ENDPROC 18580LOCALT$,T%,C%:IFw%(1)<=0:ENDPROC 18590PROCreadpointer:PROCwtof(mh%) 18600T%=&F000000:IFwind%=1ANDfile%=sbfile%:T$=FNsubdesc2(FNitos) 18610C%=&D000000:IFT$=""C%=&7000000:T$=FNsubdesc2(FNv_(11)) 18620PROCgeti(w%(1),0):IF(q%!24ANDT%)<>C%:PROCiset(w%(1),0,T%,C%) 18630IFT$<>$FNia(w%(1),0):PROCseti(w%(1),0,T$) 18640ENDPROC 18650 18660DEFFNitos 18670IFmi%>4ANDmi%<29:=mi%-4+32 18680IFmi%>28ANDmi%<53:=mi%-28 18690IFmi%=1:=0 18700IFmi%>52ANDmi%<63:=mi%-53+256 18710=-1 18720 18730DEFPROCselsub(s%):IFs%>255ORs%<0ORs%=FNv_(11):ENDPROC 18740SYSswi%,subset_%,s% 18750IFw%(3)>0PROCforce(w%(3)) 18760PROCshowsub:ENDPROC 18770 18780DEFPROCexpandsort 18790LOCALERROR 18800ONERRORLOCAL:RESTOREERROR:ox$(0)=""""+REPORT$+"""":ENDPROC 18810ox$(0)=FNx1(o$(0)):ENDPROC 18820 18830DEFPROCsd35 18840D%=FNv_(14):N%=FNv_(15) 18850IFN%=0ORD%=0:G%=1:ENDPROC 18860IFFNbadrec(N%)THEN 18870IFFNbadrec(D%):G%=1:ELSEG%=0 18880ELSE 18890SYSswi%,sd35_%,N%TOG% 18900ENDIF 18910ENDPROC 18920 18930DEFFNbadrec(T%):=(T%AND&7FFFFF00)=&7FFFFF00 18940 18950DEFPROCscrsz 18960!workbuf%=4:workbuf%!4=5:workbuf%!8=11:workbuf%!12=12:workbuf%!16=-1 18970SYS"OS_ReadVduVariables",workbuf%,workbuf%+24 18980q%!32=(workbuf%!32)<<(workbuf%!24):q%!36=(workbuf%!36)<<(workbuf%!28) 18990ENDPROC 19000 19010DEFPROCexpr 19020dialreason%=r%:dialfile%=file% 19030LOCALT%,T$,A$,t$,s%,u%,a% 19040T$=FNfilename:w_sortex%=FNcrwind(tw_sortex%):PROCunselall(w_sortex%) 19050T$=fi$+T$+", sort by:" 19060A$=o$(0):exi0%=17 19070s%=(o%(0,0)AND4)<>0 19080u%=(o%(0,0)AND2)<>0 19090a%=(o%(0,0)AND1)<>0 19100PROCseti(w_sortex%,16,T$):PROCseti(w_sortex%,17,A$):ex$=A$ 19110IFs%PROCseli(w_sortex%,1) 19120IFu%PROCseli(w_sortex%,0) 19130IFa%PROCseli(w_sortex%,19) 19140PROCseti(w_sortex%,20,FNsubdesc1(FNv_(11))) 19150PROCdialogue(w_sortex%):ENDPROC 19160 19170DEFFNenterfield 19180LOCALW%,T%,T$,t$:RESTORE19720 19190REPEAT:PROCreadh(W%):IFW%<>mh%THEN 19200IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 19210ELSE 19220REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 19230IFW%=mi%THEN 19240CASET%OF 19250WHEN1,4 19260T$=FNaddfield($FNia(mh%,mi%),menufield%)+T$:PROCseti(mh%,mi%,T$) 19270WHEN6:PROCseti(mh%,mi%,FNaddfield($FNia(mh%,mi%),menufield%)) 19280ENDCASE 19290ENDIF 19300=TRUE 19310ENDIF 19320UNTILW%<0 19330=FALSE 19340 19350DEFFNenternote 19360LOCALW%,T%:RESTORE19720 19370REPEAT:PROCreadh(W%):IFW%<>mh%THEN 19380IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 19390ELSE 19400REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 19410IFW%=mi%THEN 19420CASET%OF 19430WHEN1,4,6,7 19440IFdragbutton%=64THEN 19450IFmi%<>menufield%ORmh%<>w%(4)PROCseti(mh%,mi%,$FNia(mh%,mi%)+"'"+CHR$(menufield%+65)) 19460ELSE 19470PROCseti(mh%,mi%,FNnote(menufield%)) 19480ENDIF 19490ENDCASE 19500ENDIF 19510=TRUE 19520ENDIF 19530UNTILW%<0 19540=FALSE 19550 19560DEFFNentersub 19570LOCALW%,T%:RESTORE19720 19580REPEAT:PROCreadh(W%):IFW%<>mh%THEN 19590IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 19600ELSE 19610REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 19620IFW%=mi%THEN 19630CASET%OF 19640WHEN1:PROCseti(mh%,mi%,$FNia(mh%,mi%)+FNsubdesc4(menusub%)) 19650WHEN2:PROCsfsub(menusub%) 19660ENDCASE 19670ENDIF 19680=TRUE 19690ENDIF 19700UNTILW%<0 19710=FALSE 19720DATAw_sortex%,17,1,20,2,21,3,-1,-1 19730DATA"w%(4)",0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1,8,1,9,1,10,1,11,1,12,1,13,1,14,1,15,1,16,1,17,1,18,1,-1,-1 19740DATA-1 19750 19760DEFPROCsfsub(T%):IFT%>255OR(T%AND31)=FNv_(11):ENDPROC 19770PROCseti(w_sortex%,20,FNsubdesc1(T%)) 19780PROCselsub(T%):ENDPROC 19790 19800DEFPROCsubsdr 19810LOCALT%,T$ 19820PROCsubdisp1:PROCwtof(mh%):IFfile%>=0THEN 19830CASEwind%OF 19840WHEN0:PROCselsub(menusub%) 19850OTHERWISE:IFFNentersub 19860ENDCASE 19870ELSE 19880CASEmh%OF 19890OTHERWISE:IFNOTFNentersub 19900ENDCASE 19910ENDIF 19920ENDPROC 19930 19940DEFPROCreadh(RETURN T%) 19950LOCALT$:READT$:T%=EVALT$ 19960ENDPROC 19970 19980DEFPROCnotepad 19990IFw%(4)<=0:PROCmakenotes:ENDPROC 20000PROCfront(w%(4),-1,-1) 20010ENDPROC 20020 20030DEFPROCclearnpad:LOCALI%:FORI%=0TO18:PROCnote(I%,""):NEXT:ENDPROC 20040 20050DEFPROCsavenotes 20060LOCALI%:FORI%=0TO18:PROCdprint(FNs(FNnote(I%))):NEXT:ENDPROC 20070 20080DEFPROCdprint1(T$):BPUT#outfile%,T$;:ENDPROC 20090DEFPROCdprint(T$):PROCdprint1(T$):PROCdnewl:ENDPROC 20100DEFPROCdnewl:BPUT#outfile%,"":ENDPROC 20110 20120DEFFNcancel:LOCALX%,Y%,B%,T%,I%,A$ 20130MOUSEX%,Y%,B% 20140IFB%AND5:T%=X%>=sortx0%ANDX%<=sortx1%ANDY%>=sorty0%ANDY%<=sorty1% 20150IFINKEY0<>27ANDNOTT%:=FALSE 20160PROCnormpoint 20170RESTORE+1:FORI%=1TO5:READA$:PROCtsortmess(I%,A$):NEXT 20180REPEAT:MOUSEX%,Y%,B%:UNTILB%=0ANDINKEY0<0 20190REPEAT:MOUSEX%,Y%,B%:T%=INKEY0:UNTIL(B%AND5)OR(T%>=0) 20200PROCrestorem:T%=T%=27 20210IFNOTT%T%=(B%AND5)ANDX%>=sortx0%ANDX%<=sortx1%ANDY%>=sorty0%ANDY%<=sorty1% 20220PROCwaitpoint 20230=T% 20240DATA" Really interrupt sort ?" 20250DATA 20260DATA" � Click [Cancel] to interrupt" 20270DATA" � Click any other to continue" 20280DATA 20290 20300DEFPROCinterrupt:IFFNcancel:PROCerr(308) 20310DEFPROCclearmess:LOCALI%:FORI%=1TO5:PROCsortmess(I%,""):NEXT 20320DEFPROCnewmess(A$):PROCclearmess:PROCsortmess(1,A$) 20330ENDPROC 20340 20350DEFPROCsortmess(I%,A$):LOCALT%:T%=TRUE 20360DEFPROCtsortmess(I%,A$):LOCALT%:T%=FALSE 20370IFI%>5ORI%<1:ENDPROC 20380LOCALY%:Y%=sorty%+sorth%-I%*linegap%-8 20390PROCgcol(0,2):RECTANGLEFILLsortx%,Y%,sortw%,linegap%-4 20400PROCgcol(0,7):MOVEsortx%+8,Y%+linegap%-4:VDU5 20410IFT%sortm$(I%-1)=A$ 20420PRINTA$;:ENDPROC 20430 20440DEFPROCrestorem 20450LOCALI%:FORI%=1TO5:PROCsortmess(I%,sortm$(I%-1)):NEXT:ENDPROC 20460 20470DEFPROCendsort 20480LOCALA$,T$:A$=" ":T$=CHR$10+CHR$13 20490time$=T$+"Fill buffer: "+RIGHT$(A$+FN`(t1%)+"s",12) 20500time$+=T$+"Sort buffer: "+RIGHT$(A$+FN`(t2%)+"s",12) 20510time$+=T$+"Swap cards: "+RIGHT$(A$+FN`(t3%)+"s",12) 20520time$+=T$+" ------------" 20530time$+=T$+"Total: "+RIGHT$(A$+FN`(t1%+t2%+t3%)+"s",12) 20540time$+=T$+" ------------" 20550time$+=T$+T$+"("+STR$entries%+" slots of "+STR$Z%+" bytes; top="+STR$(sortsz%DIVminZ%)+")" 20560PROCnormpoint:PROCiconupd(w_sort%,6) 20570IFw%(3)>0PROCforce(w%(3)) 20580SYSswi%,grec_%,0TON% 20590SYSswi%,sd38_%,255 20600SYSswi%,sd38_%,255 20610ENDPROC 20620 20630DEFPROCsortfile 20640LOCALI% 20650LOCALERROR 20660ONERRORLOCAL:RESTOREERROR:PROCendsort:PROCerr(307) 20670minZ%=7 20680PROCwaitpoint:PROCgetw(w_sort%) 20690sortx%=bx%+12:sorty%=by%-450:sortw%=537:sorth%=209 20700sortx0%=bx%+384:sorty0%=by%-196:sortx1%=bx%+491:sorty1%=by%-148 20710PROCclearmess:maxslots%=FNv_(17):Z%=sortsz%DIVmaxslots% 20720IFZ%<minZ%:Z%=minZ%:maxslots%=sortsz%DIVZ% 20730IFZ%>300Z%=300 20740IFmaxslots%>65535maxslots%=65535 20750PROCsorttype:t1%=0:t2%=0:t3%=0 20760PROCnewmess("Reading sort information"):PROCfillbuff 20770PROCnewmess("Sorting data"):PROCsortbuff 20780PROCnewmess("Writing file"):PROCwriteptrs 20790PROCendsort:ENDPROC 20800 20810DEFPROCfillbuff 20820PROCsortmess(3," Card number:") 20830entries%=0 20840SYSswi%,first_%TO,N% 20850SYSswi%,sd23_%TON% 20860SYSswi%,next_%TON% 20870t1%=TIME:WHILENOTFNbadrec(FNv_(15)) 20880IFentries%>maxslots%:PROCerr(309) 20890IF(entries%AND15)=0:PROCsortmess(4," "+STR$(FNv_(17)-FNv_(15))) 20900PROCfillslot(entries%):entries%+=1:PROCinterrupt 20910SYSswi%,next_%TON% 20920ENDWHILE:t1%=TIME-t1% 20930IFentries%<2PROCerr(310) 20940ENDPROC 20950 20960DEFPROCsortbuff 20970LOCALA%,I%,J%,K%,M%,P%,T%,I$,L$,T$,L% 20980A%=-1:IFo%(0,0)AND1:A%=1 20990mrecs%=entries% 21000M%=mrecs%DIV2:REPEAT:M%=M%DIV2:L%+=1:UNTILM%=0 21010M%=mrecs%DIV2:t2%=TIME 21020WHILEM%>0 21030PROCsortmess(3," Level "+STR$L%):L%-=1 21040J%=1:K%=mrecs%-M% 21050WHILEJ%<=K% 21060IF(J%AND127)=1:PROCsortmess(4," Record "+STR$(K%-J%)):PROCinterrupt 21070I%=J% 21080P%=I%+M% 21090WHILEI%>0 21100T%=FNcomp(I%,P%) 21110IFT%=A%:PROCswap(I%,P%):I%-=M%:ELSE:I%=-1 21120P%=I%+M% 21130ENDWHILE 21140J%+=1 21150ENDWHILE 21160M%=M%DIV2 21170ENDWHILE:t2%=TIME-t2% 21180ENDPROC 21190 21200DEFPROCwriteptrs 21210SYSswi%,first_%TO,N% 21220LOCALI%,A%,B%,C%,D%,T%,on%,nn%:B%=V% 21230t3%=TIME:FORI%=1TOentries% 21240IF(I%AND31)=1PROCsortmess(3," Record "+STR$(entries%-I%)):PROCinterrupt 21250SYSswi%,next_%TON% 21260on%=FNv_(15):nn%=!(B%+I%*Z%-Z%)AND&FFFF 21270IFon%<>nn%THEN 21280SYSswi%,sd32_%,on%,nn% 21290A%=I%:C%=on%:D%=Z%:T%=USRsearch% 21300PROCswap(I%,T%) 21310SYSswi%,grec_%,on%TON% 21320ENDIF 21330NEXT 21340t3%=TIME-t3%:ENDPROC 21350ENDPROC 21360 21370DEFPROCfillslot(T%) 21380LOCALA%,T$:A%=T%*Z%+V%:!A%=FNv_(15) 21390CASEtype%OF 21400WHEN0:SYSswi%,gfield_%,field% 21410PROCremove($sd%,"."):A%!2=VAL$sd% 21420WHEN1:SYSswi%,gfield_%,field% 21430IFo%(0,0)AND2:SYSswi%,upper_% 21440IFo%(0,0)AND4:SYSswi%,strip_% 21450$(A%+2)=LEFT$($sd%,Z%-2) 21460WHEN2:|(A%+2)=FNev(ox$(0),o%(0,0)AND4,o%(0,0)AND2) 21470WHEN3:$(A%+2)=LEFT$(FNev(ox$(0),o%(0,0)AND4,o%(0,0)AND2),Z%-2) 21480ENDCASE:ENDPROC 21490 21500DEFFNslotval(A%) 21510CASEtype%OF 21520WHEN0:=A%!2 21530WHEN1,3:LOCALT$,T%:T%=A%?Z%:T$=$(A%+2):A%?Z%=T%:=T$ 21540WHEN2:=|(A%+2) 21550ENDCASE:="" 21560 21570DEFFNcomp(A%,B%):LOCALA,B,A$,B$,T% 21580A%=V%+A%*Z%-Z%:B%=V%+B%*Z%-Z% 21590CASEtype%OF 21600WHEN0:A%=FNslotval(A%):B%=FNslotval(B%):=(A%<B%)-(A%>B%) 21610WHEN2:A=FNslotval(A%):B=FNslotval(B%):=(A<B)-(A>B) 21620ENDCASE 21630A$=FNslotval(A%):B$=FNslotval(B%):IFA$<>B$:=(A$<B$)-(A$>B$) 21640IFLENA$<Z%-2:=0 21650A%=!A%:B%=!B%:SYSswi%,locate_%,A%TOD% 21660A$=FNev(ox$(0),o%(0,0)AND4,o%(0,0)AND2):SYSswi%,locate_%,B%TOD% 21670B$=FNev(ox$(0),o%(0,0)AND4,o%(0,0)AND2):=(A$<B$)-(A$>B$) 21680 21690DEFPROCswap(A%,B%) 21700A%=V%+A%*Z%-Z%:B%=V%+B%*Z%-Z% 21710SWAP?A%,?B%:SWAPA%?1,B%?1:CASEtype%OF 21720WHEN0:SWAPA%!2,B%!2 21730WHEN2:SWAP|(A%+2),|(B%+2) 21740WHEN1,3 21750LOCALT%,U% 21760T%=?(A%+Z%):U%=?(B%+Z%):SWAP$(A%+2),$(B%+2) 21770?(A%+Z%)=T%:?(B%+Z%)=U% 21780ENDCASE 21790ENDPROC 21800 21810DEFPROCsorttype 21820LOCALT$:T$=ox$(0) 21830SYSswi%,sd59_%,T$TOG% 21840IFG%<-1THEN 21850field%=G%AND&FFFFFF 21860SYSswi%,sd17_%,4,field%TOG% 21870IF(G%AND7)=7:type%=1:ELSEtype%=0 21880ELSE 21890field%=-1 21900type%=FNexprtype 21910ENDIF 21920ENDPROC 21930 21940DEFFNexprtype:LOCALT$ 21950LOCALERROR:ONERRORLOCAL:RESTOREERROR:IFERR=6:=2:ELSEPROCerr(306) 21960T$=FNev(ox$(0),TRUE,TRUE):=3 21970 21980DEFPROCnovars 21990ENDPROC 22000 22010DEFPROCpicpath:LOCALT$:IFLENfile$>230:ENDPROC 22020T$=FNArfVar("MultiStorePics$Path"):IFINSTR(FNu(T$),FNu(file$)):ENDPROC 22030file$+=".":WHILELENT$+LENfile$>229 22040REPEAT:T$=LEFT$(T$):UNTILRIGHT$(T$)=","ORT$="":T$=LEFT$(T$) 22050ENDWHILE:IFT$>"":file$+="," 22060OSCLI"Set MultiStorePics$Path "+file$+T$ 22070FORI%=0TOmaxf%:IFw%(I%,0)>0PROCforce(w%(I%,0)) 22080NEXT:ENDPROC 22090 22100DEFFNaddfield(T$,T%) 22110LOCALC%,t$,A$:t$=T$:WHILERIGHT$(t$)=" ":t$=LEFT$(t$):ENDWHILE 22120IFt$="":=FNfname1(T%) 22130IFRIGHT$(t$)="@"ORRIGHT$(t$)="#":=t$+FNfname(T%) 22140C%=FALSE:RESTORE+1:REPEAT:READA$:C%=RIGHT$(t$,LENA$)=A$ 22150UNTILC%ORA$="****":IFNOTC%T$+="+" 22160IFINSTR(T$,"@"):=T$+"@"+FNfname(T%) 22170IFINSTR(T$,"#"):=T$+"#"+FNfname(T%) 22180=T$+FNfname1(T%) 22190DATA+,-,*,/,AND,OR,NOT,>,<,=,(,",",":",****
"�> <MultiStore$Dir>.MSFastSort ?� By Merlyn Kline for Copyright (c) Minerva Software, 1989 : version$="2.02" ( 2�:�error(�,�$,�,�) < �init F3�:�error(�,�$,�,process%<4�process%>0):�report P�normpoint Z d� n�process%>0:�process x(ș"Wimp_PollIdle",,q%,delay%�reason% �2�taskhandle%>0:șswi%,selecttask_%,taskhandle% ��respond(reason%) � �quit% ��CLOSE:�quit(�) �� � ���respond(reason%) ��reason%:�waitpoint �Ȏreason%� �� 0:�backgrnd �� 1:�redraw(�) �:� 2:�open(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24,q%!28) �� 3:�closew(!q%) � 4:�ptrexit(!q%) � 5:�ptrenter(!q%) /� 6:�mouse(!q%,q%!4,q%!8,q%!12,q%!16,q%!20) "� 7:�enddrag ,3� 8:�key(!q%,q%!4,q%!8,q%!12,q%!16,q%!20,q%!24) 6� 9:�menuselect @�17,18:�umess1 J�19:�umess2 T� ^�normpoint h� r |!��quit(T%):�normpoint:�novars �1$q%="TASK":ș"Wimp_CloseDown",taskhandle%,!q% ��T%��debug:�tidy:� �!șswi%,killtask_%,taskhandle% �Ș � �ݤtask=otask% � ���init:otask%=Z%:�swinums �!appl$="MultiStore":pstream%=0 �'� q% 2500, workbuf% 1500,dialct% 24 �7waiter%=0:file%=-1:v%=�initwimp:�v%<180:�12:�err(2) �!�waitpoint:ț(�dir+"BaseLib") �ț(�dir+"SwiList"):�swilist 'quit%=�:dialreason%=-1:dialogue%=-1 ackpending%=�:ackref%=-1 dragreason%=-1 &savereason%=-1 0file2%=-1:reason2%=-1 :menufile%=-1:menusub%=-1 Dcloseok%=� N)sbfile%=-1:pass$="":exi0%=-1:exi1%=-1 X"ș"OS_Byte",182,0,255 �,pterm% b0�(pterm%�&80)=0ș"OS_Byte",246,0,255�,pterm% l �pterm%=10pterm%=1:�pterm%=2 v$id_wcia%=42:id_exb%=43:id_bbc%=0 �� edbuf% 256,edval% 15 �?edfield%=-1:edicon%=-1:edrec%=-1:edx%=-1:$edval%="a0-9\-+." �&ss%=12:lc%=3:�readparams:�filevars �*�loadsprites:�defws:�defmenus:�version �$process%=1:checkref%=-1:delay%=0 �+lastact%=0:chunk%=7:fn$="":startsort%=� �Ias$="Are you sure ?":rl$="Really ":ri$=rl$+"interrupt ?":fi$="File: " �sy$="Sorry! ":� sortm$(4) �'�23,255,0,126,126,126,126,126,126,0 �%sortsz%=�-�P-60*1024:� V% sortsz% ��ass:�baricon:� � � ��swinums � ��filevars /ft_form%=&DE7:ft_data%=&DE8:maxw%=4:maxf%=0 *$� w%(maxw%),ma$(30),st%(maxf%,2) 4>� fl%(maxf%),d$(maxf%,23),f$(maxf%),fx$(maxf%),t%(maxf%,3) >$� tw%(maxw%),e$(maxf%),r%(maxf%) H2� l$(maxf%),lx$(maxf%),lk$(maxf%),w$(maxf%,14) RH� wo%(maxf%),o$(maxf%),o%(maxf%,6),r$(maxf%),sr$(maxf%),ll%(maxf%,5) \?� lf%(maxf%,15),p%(maxf%,4),p$(maxf%,7),c$(maxf%,maxcol%,1) f"� c%(maxf%,maxcol%),ox$(maxf%) p;f_filt%=1<<00:f_pane%=1<<01:f_macb%=1<<02:f_mace%=1<<03 z;f_fspc%=1<<04:f_fupp%=1<<05:f_sspc%=1<<06:f_supp%=1<<07 �;f_sadd%=1<<08:f_rspc%=1<<09:f_rupp%=1<<10:f_srup%=1<<11 �;f_stot%=1<<12:f_stit%=1<<13:f_sdas%=1<<14:f_wspc%=1<<15 �;f_wupp%=1<<16:f_wbnk%=1<<17:f_7bit%=1<<18:f_rejb%=1<<19 �;f_reja%=1<<20:f_rdsp%=1<<21:f_rtpn%=1<<22:f_rbpn%=1<<23 �;f_rpdt%=1<<24:f_rtpg%=1<<25:f_rtsu%=1<<26:f_rldu%=1<<27 �f_rlsu%=1<<28 �[f_reps%=f_rldu%�f_rlsu%�f_rejb%�f_reja%�f_rdsp%�f_rtpn%�f_rbpn%�f_rpdt%�f_rtpg%�f_rtsu% �!f_save%=-1��(f_pane%�f_sadd%) �Kf_dflt%=f_fspc%�f_fupp%�f_sspc%�f_supp%�f_stot%�f_stit%�f_sdas%�f_wspc% �fn$="":hand%=0 �� � ���sdvars șswi%,sd64_%,3�linegap% margin%=8 1�sound%:șswi%,opt_%,10�G%:�șswi%,opt_%,9�G% $� . 8-��checkprot:�T%:ș"FlexiFile_Address"�sd% B� L��:process%=2:� Vșswi%,reset_%,taskhandle% `T�process%=3�stop(1,"OK. Please remove original &","replace backup if necessary") jdate$=�strdate1(�now,4) t�sdvars:�v_(1)<>0�err(3) ~process%=4:� � � ��version �/�T$:T$=version$:笤prod:T$+=" *UNFINISHED*" �8�seti(w_pinfo%,4,"v"+T$):$�tia(tw_status%,11)="v"+T$ �� � �,ݤprod=�version$,�version$,".")+1,1)="0" �ݤdebug=��prod ��-1��-2 � �>ݤinitwimp:first%=�:taskhandle%=�task:�taskhandle%<>0:=200 �G$q%="TASK":ș"Wimp_Initialise",200,!q%,"MultiStore"�!q%,taskhandle% �first%=�:=!q% ��tidy � �normpoint (�4,26:�0,3);:*fx4 2*fx225,1 < *fx229 FZ%=0:șswi%,killtask_% P��:��:�:�" ";�:� Z+�;menuend%-menufree%" bytes menu space" d6�;endbuf%-curbuf%" bytes indirection buffer space" n'�;tbe%-tbs%" bytes template buffer" x� � ���baricon:�first%:� �+!q%=-1:q%!4=0:q%!8=0:q%!12=102:q%!16=68 �0q%!20=%11000000000010:$(q%+24)="!"+�appl$,9) �$ș"Wimp_CreateIcon",,q%�baricon% �� � ���strip(� T$) �$sd%=T$:șswi%,strip_% �T$=$sd% �� � �!��error(err%,err$,erl%,quit%) *�debug:�4,30:�err$" @ ";erl%:�quit(�) .�normpoint:dragreason%=-1:@%=&90A:*fx229,1 �i%,e%,t$,T$ "笤prod:err$+=" ("+Þ+")" ,� 6��:�error(�,�$,�,�) @9!q%=err%:$(q%+4)=err$:ș"Wimp_ReportError",q%,1,appl$ J�quit%:�quit(�) T� ^ h+��report:�debug:�4:�:�" @ ";�:�quit(�) r� | � ݤdir � �T$:T$=�ArfVar(appl$+"$Dir") �!�T$="":T$="&.!"+�appl$,9)+"." ���T$)<>".":T$+="." �=T$ � �ݤArfVar(A$):�L%,T% �=ș"XOS_ReadVarVal",A$,workbuf%,254,0,3�,,L%;T%:�T%�1:L%=0 �workbuf%?L%=13:=$workbuf% � ���umess1 �-ref%=q%!8:task%=q%!4:�task%=taskhandle%:� �mess%=q%!16 Ȏmess%� �0:�CLOSE:�quit(�) �1:�datasaved &�2:�savedata 0�3:�dataload :�4:ackpending%=� D�5:�dataopen N�6: X�7: b�8:�prequit l�9: v �&502: �-�&400C0:�submenu(q%!20,q%!24,q%!28,q%+32) ��&80300:�ackrec �� �� � ���dataopen �(�q%!40=ft_form%:�dataloadack:�err(1) ��q%!40<>ft_data%:� �"�dataloadack:mh%=-1:�checkopen �B�process%=0:笤dialogue:�mstore("2:"+�zts(q%+44),"MultiStore") �� � ���dataload $�T$:T$=�zts(q%+44):del%=q%!12<>0 �readpointer:�wtof(mh%) Ȏ � � R� q%!40=&1000:file$=�zts(q%+44):�stop(38,�file$,29),rl$+" set picture path ?") *� q%!40=ft_data%�mh%=-2 4�dataloadack >C�process%=0笤dialogue:�checkopen:�mstore("3:"+T$,"MultiStore") H� q%!40=&FFD �mh%=-2 R*�process%=0:笤dialogue:�checkconv(T$) \0� q%!40=ft_form%�mh%=-2:�dataloadack:�err(1) f<� q%!40=ft_form%�file%>=0�wind%<2:�dataloadack:�err(300) p+� q%!40=ft_data%�mh%=w_sort%:�checkopen z/�-3:�opensort(T$):��opensort1(T$,7,0,"",0) �2� ;{n. ALT to open sort file with dialogue box �c� q%!40=&FFF �file%>=0�wind%=4:�dataloadack:file$=T$:�stop(14,fi$+�filename,rl$+"load notes ?") �� �� � � ��noscrap ��del%:*remove <Wimp$Scrap> �� � ���datasaved:�dialogue:� ��readpointer:�wtof(mh%) � Ȏ � � �A� q%!40=&FFF �file%>=0�(wind%=6�wind%=7�wind%=0):�datasaveack � � $ ��err(E%) .9�T$,A$:�file%>=0A$=", "+fi$+�filename+" - ":�A$=" - " 8@%=&90A:*fx229,1 B ȎE%� L�0:T$=�$ V0�1:T$="To use a format, drag it onto a card" `-�2:T$="Must be version 1.8 WIMP or later" j+�3:T$=sy$+"Too many files already open" t>�4:T$=sy$+"You can only run one RAMManager task at a time" ~H�5:T$="To save, drag the icon to a directory viewer or another task" �c�6:T$="Couldn't open file: "+�$:�$="Data lost":T$+=" (Ensure the disc is not write protected)" �%�7:T$="Couldn't open format: "+�$ �(�10:T$="Unbalanced quote marks ("")" � �11:T$="Unbalanced brackets" �1�16:T$="Field names must start with a letter" �&�24:T$="Field assignment expected" �%�25:T$="Field name not specified" �1�29:T$="Illegal notepad reference identifier" �9�30:T$="Abbreviated expression too complex to expand" �%�31:T$="Illegal pattern matching" �+�35:T$="Expression should not be blank" �#�41:T$="Printer already in use" 9�46:T$="Exporting report"+A$+�$+" (export cancelled)" E�47:T$="The two new passwords must be identical. Please re-enter" 1�50:T$="Can't recognise format of setup file" <�51:T$="You must specify the current password correctly" (�59:T$="Program not found" 20�60:T$=�$+" - Can't load requested software" <6�300:T$=sy$+"You can't load formats while sorting" FI�301:T$=sy$+"You can't open a file while another is open for sorting" PD�302:T$="Please close the sort file before cancelling sort mode" ZR�303:T$="Please open sort file (by dragging to sort window) before proceeding" dK�305:T$=sy$+"You can't create a file while another is open for sorting" n#�306:T$="Sort expression"+A$+�$ x�307:T$=�$+" - Sort failed" �)�308:T$="User interrupt acknowledged" �,�309:T$="Too many records for fast sort" �)�310:T$="Not enough records to sort!" �&:T$="Unrecognised internal error" �� �%笤prod:T$+=" ("+Þ+") ["+�E%+"]" � �99,T$ � ���opensort(f$):�s(f$)="":� �Aw_open%=�crwind(tw_open%):�unselall(w_open%):�seli(w_open%,8) �6file$=f$:�seti(w_open%,13,f$):�seti(w_open%,14,"") �#�shadeopen:�dialogue(w_open%):� � ,��opensort1(f$,m%,d%,p$,r%):�s(f$)="":� �I%,g%,h%,X%,Y%,T$ � "��:��:�loaderr:� ,p$=�su(p$) 6�v_(1)�err(3) @@�waitpoint:T$=f$:m%=�(99/(maxf%+1)+(99-(99/(maxf%+1)))*m%/7) Jw%(0)=�crwind(tw%(0)) T�p$=""p$=�pwcode(pass$) ^3pass1$=p$:pass$=�pwcode(p$):�clearpass%pass$="" hșswi%,password_%,p$ r%g%=0:șswi%,open_%,T$,m%,d%,r%�G% |%g%=G%:�g%�?sd%<>13��warnfile:g%=� �hand%=�v_(2):�initfile �șswi%,selectkey_%,"?" �șswi%,sd45_%,"N" �/$�ta(w%(0))="Sort="+�filename:�fext:�readws ��expandsort �9�open(w%(0),16,404,512,900,0,0,-1):șswi%,grec_%,0�N% �șswi%,sd57_%,"bit7"�G% �șswi%,order_%�N% ��flg(f_7bit%,G%) ��makesort:�fastsort �șswi%,sd38_%,255 �șswi%,sd38_%,255 � fn$=f$:�g%�dialogue(w_mess%) � ��warnfile &*�T%,t%,I%,T$:w_mess%=�crwind(tw_mess%) 0�+1:�I%=0�7:�T$ :)�g%�(2^I%):�seti(w_mess%,T%,T$):T%+=1 D�:�$sd%>""� NJ�seti(w_mess%,T%,"Password violations have occured as follows:"):T%+=1 Xt%=sd%:� b>�t%<sd%+192:�$t%>"":�seti(w_mess%,T%," Using "+$t%):T%+=1 lt%+=64:�t%=sd%+192 v� �)ȕT%<6:�seti(w_mess%,T%,""):T%+=1:�:� �>�"** This file MAY be CORRUPTED due to illegal closure **" �<�" ** This file has been accessed by older software **" � �,,,, � ���initfile �+f$(h%)="":fx$(h%)="":e$(h%)="":r%(h%)=1 �8o$(h%)="":o%(h%,0)=7:r$(h%)="":�I%=0�3:t%(h%,I%)=0:� �.l$(h%)="":lk$(h%)="":lx$(h%)="":sr$(h%)="" �p%(h%,0)=0:p$(h%,0)="" �3�I%=0�23:d$(h%,I%)="":�:�I%=0�18:�note(I%,""):� �#�I%=0�29:ma$(I%)="":�:wo%(h%)=0 �3�I%=0�15:lf%(h%,I%)=0:�:�I%=0�14:w$(h%,I%)="":� Lll%(h%,0)=30:ll%(h%,1)=4:ll%(h%,2)=4:ll%(h%,3)=9:ll%(h%,4)=2:ll%(h%,5)=1 fl%(h%)=f_dflt% � * ��loaderr 4�normpoint:�h%>=0� >�g%:�delw(w_mess%) H�w%(0)>0�delw(w%(0)) R�hand%>0:�closefile \�=&80301� fDw_open%=�crwind(tw_open%):�unselall(w_open%):�seli(w_open%,m%+1) p�d%�seli(w_open%,0) z6file$=f$:�seti(w_open%,13,f$):�seti(w_open%,14,"") �,�shadeopen:�dialogue(w_open%):file%=-1:� �� �� �file%=-1:�err(6):� � ���closefile:�I% ��ready:�writews:�delfilews �hand%=0:w%(0)=-1E9 �closeok%=� �șswi%,close_%�S% � �fastsort �� � ��align(I%):�tx1%-tx0%>108:� tx0%=I%*40+16:tx1%=tx0%+440 ty1%=900-I%*40:ty0%=ty1%-320 $� . 8��makeflist:�X%,Y%,P%,T% B6P%=�makewind(2):T%=�ta(P%):$T%="Fields="+�filename L T%=�$T%+4:șswi%,sd64_%,1�G% V�G%<T%G%=T% `X%=G%:�X%<21X%=21 jY%=�v_(7):�Y%<2Y%=2 t3�wext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2) ~� � ���makenotes �5�P%:P%=�makewind(4):$�ta(P%)="Notepad="+�filename �� � ���makesubs ��P%,T$,I%,J%,K%,T% �1K%=w%(1)>0:�K%�getw(w%(1))��readblock(tw%(1)) �1tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:�align(1) �,�delfilew(1):P%=�crwind(tw%(1)):w%(1)=P% �'$�ta(w%(1))="Subsets of "+�filename �T$=�substr:�I%=0�23 <�T$,I%+1,1)<>".":�loseicon(P%,I%+5):�loseicon(P%,I%+29) � *ȕT$>""��T$)<>".":T$=�T$):�:T$=�T$,24) +C%=((�T$-1)�6+1)*56+62:�K%:C%=ty1%-ty0% (4T%=(3-(�T$-1)�6)*56:J%=0:�I%=0�9:T$=�subname(I%) 2�seti(P%,I%+53,T$):�T$=""� <�loseicon(P%,I%+53) F� P.�geti(P%,I%+53):�delicon(P%,I%+53):J%=I%+1 Z:q%!4=!q%:q%!12+=T%:q%!20+=T%:ș"Wimp_CreateIcon",,q%+4 d� n �:�geti(P%,4):�delicon(P%,4) x:q%!4=!q%:q%!12+=T%:q%!20+=T%:ș"Wimp_CreateIcon",,q%+4 �8T%+=((10-J%)�5)*64:�getw(P%):�wext(P%,ex1%,-ey0%-T%) �?�open(w%(1),tx0%,ty1%-C%,tx1%+x1%-x0%,ty1%,0,0,-1):�showsub �� � ���makesort �8�P%,X%,Y%:P%=�makewind(3):$�ta(P%)="Sort="+�filename �HX%=255:Y%=�v_(17):�wext(w%(3),X%*16+margin%*2,Y%*linegap%+margin%*2) �� � � ��subs ��w%(1)<=0:�makesubs:� ��front(w%(1),-1,-1) �� ��sortw �w%(3)<=0:�makesort:� "�front(w%(3),-1,-1) ,� 6 @ݤmakewind(T%):�P%,I%,K% J4K%=w%(T%)>0:�K%�getw(w%(T%))��readblock(tw%(T%)) T2tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:�align(T%) ^/�delfilew(T%):P%=�crwind(tw%(T%)):w%(T%)=P% h,�open(P%,tx0%,ty0%,tx1%,ty1%,0,0,-1):=P% r |1ݤcrwind(T%):ș"Wimp_CreateWindow",,T%�T%:=T% � ���showsub:�P% �P%=w%(1):�P%>0� �'�subdisp1:�unselall(P%):�v_(11)=0� ��seli(P%,1) �� ��seli(P%,(�v_(11)�31)+28) �(�v_(11)>31:�seli(P%,(�v_(11)�31)+4) �� �� �� � �(��delfilews:�I%:�w%(0)>0�delw(w%(0)) !�I%=1�maxw%:�delfilew(I%):�:� ��delfilew(I%) &4�w%(I%)>0:�closew(w%(I%)):�w%(I%)>0�delw(w%(I%)) 0� : D��umess2 NȎq%!16� X$�6:�q%!8=loadref%:�datasaveack:� b� l� v ���backgrnd:�T% ��sbfile%>=0�subdisp �0�startsort%:startsort%=�:�newdelay:�sortfile ��ackpending%:ackpending%=� �� � ���template(T$) ��template1(T$,q%) �� � �/��template1(T$,q%):T$=�lower(T$):� I%,T%,L% �5I%=temp%+16:ȕ!I%>0��lower($(I%+12))<>T$:I%+=24:� �-�!I%<=0:�99,"Template '"+T$+"' not found" CT%=temp%+!I%:L%=I%!4:�I%=0�L%�4:q%!I%=T%!I%:�:T%=q%+88+q%!84*32 �(q%!56)�(1<<8)� 3q%!72=�workspace(q%!80):$(q%!72)=$T%:T%+=�$T%+1 =�q%!76>0:q%!76=�workspace(�$T%+1):$(q%!76)=$T%:T%+=�$T%+1 *� 4 �q%!84>0� >�I%=q%+88�q%+84+q%!84*32�32 H�(I%!16)�(1<<8)� R3I%!20=�workspace(I%!28):$(I%!20)=$T%:T%+=�$T%+1 \=�I%!24>0:I%!24=�workspace(�$T%+1):$(I%!24)=$T%:T%+=�$T%+1 f� p� z� �q%!64=sprites% �� � �$��opentemplate(A$):temp%=�-30000 ��"Load "+A$+" "+�~temp%:� � �ݤtemplate(T$) ��template1(T$,tbs%) �T%=tbs%:tbs%+=88+tbs%!84*32 �)�tbs%>tbe%:�99,"Template buffer full" �=T% � ���defws �I% bufsz%=&1200 ;� buffer% bufsz%:curbuf%=buffer%:endbuf%=buffer%+bufsz% $ �opentemplate(�dir+"MSFrm7") .:�template("stopbox"):ș"Wimp_CreateWindow",,q%�w_stop% 8�template("save") B-q%!64=1:ș"Wimp_CreateWindow",,q%�w_save% L<�template("ProgInfo"):ș"Wimp_CreateWindow",,q%�w_pinfo% V>�template("ProgInfo2"):ș"Wimp_CreateWindow",,q%�w_pinfo2% `;�template("shadow"):ș"Wimp_CreateWindow",,q%�w_shadow% jbufsz%=&1F00 t6� template% bufsz%:tbs%=template%:tbe%=tbs%+bufsz% ~tw%(0)=�template("File") �tw%(1)=�template("Subsets") �!tw%(2)=�template("FieldList") �!tw%(3)=�template("FieldList") �tw%(4)=�template("Notepad") � �opentemplate(�dir+"MSFrm8") �1tw_status%=�template("Status"):w_status%=-1E9 �.tw_mess%=�template("message"):w_mess%=-1E9 �+tw_sort%=�template("sort"):w_sort%=-1E9 �+tw_open%=�template("open"):w_open%=-1E9 �1tw_sortex%=�template("Sortex"):w_sortex%=-1E9 �� � ��loadsprites ssize%=16*1024 �sprites% ssize% 2!sprites%=ssize%:ș"OS_SpriteOp",&109,sprites% (.ș"OS_SpriteOp",&10A,sprites%,�dir+"MSSpr" 2� < F��defmenus P�t$ Z� mlist% 32 dbufsz%=1100 nC� menufree% bufsz%:menuptr%=menufree%:menuend%=menufree%+bufsz% xmenustart%=menufree%:�+2 ��t$:m_main%=�crmenu(t$) �N�"#MultiStore,Info>w_pinfo%,Transfer,Fast Sort,Create,Status,Printer,Quit" ��t$:m_wind%=�crmenu(t$) �2�"#Window,Subsets,Field,Sort,Notepad#,Tidy Up" ��t$:m_file%=�crmenu(t$) ��"#File,Open" ��t$:m_card%=�crmenu(t$) �(�"#Card,File>m_file%,Window>m_wind%" ��t$:m_npad%=�crmenu(t$) �$�"#Notepad,Clear,Export>w_save%" �� � ���front(h%,X%,Y%) �getw(h%) �X%>=0x1%+=X%-x0%:x0%=X% �Y%>=0y1%+=Y%-y0%:y0%=Y% "*�open(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1) ,� 6 @4��open(oh%,ox0%,oy0%,ox1%,oy1%,oscx%,oscy%,obh%) J�O% T'!q%=oh%:ș"Wimp_GetWindowState",,q% ^�wtof(oh%):�file%>=0� hȎwind%� r:�wimpopen |� �� � Ȏoh%� �:�wimpopen �� �� �e�oh%=dialogue%�shadows%:�getw(oh%):�open(w_shadow%,x0%+ss%,y0%-ss%,x1%+ss%,y1%-ss%,0,0,dialogue%) �open%=O% �� � ���wimpopen �5!q%=oh%:q%!4=ox0%:q%!8=oy0%:q%!12=ox1%:q%!16=oy1% �>q%!20=oscx%:q%!24=oscy%:q%!28=obh%:ș"Wimp_OpenWindow",,q% �� ��closew(!q%) �I% &�wtof(!q%) 0�file%>=0� :Ȏwind%� D,�0:�showbranch:�:��closeok%:�closeok:� N� X� b�!q%=dialogue%:�tidydial lș"Wimp_CloseWindow",,q% v!�nodial:�wtof(!q%):�file%>=0� �Ȏwind%� ��0:�closefile ��1,2,3,4:�delw(w%(wind%)) �� �� � Ȏ!q%� ��w_stop%:stopfile%=-1 ��w_status%:�delw(w_status%) ��w_mess%:�delw(w_mess%) ��w_open%:�delw(w_open%) ��w_sort%:�delw(w_sort%) ��w_sortex%:�delw(w_sortex%) �� � � ��tidydial:�restorect *Ddialreason%=-1:dialogue%=-1:�closew(w_shadow%):exi0%=-1:exi1%=-1 4� > H��restorect R�:��:��:� \(ș "Wimp_GetCaretPosition",,workbuf% fp�!workbuf%=dialogue%ș "Wimp_SetCaretPosition",!dialct%,dialct%!4,dialct%!8,dialct%!12,dialct%!16,dialct%!20 p� z �;��delw(� T%):!q%=T%:ș"Wimp_DeleteWindow",,q%:T%=-1E9:� � �*ݤia(h%,i%):�geti(h%,i%):�chkii:=q%!28 �*ݤva(h%,i%):�geti(h%,i%):�chkii:=q%!32 �*ݤil(h%,i%):�geti(h%,i%):�chkii:=q%!36 � �1ݤtia(T%,i%):�q%:q%=T%+32*i%+88:�chkii:=q%!20 � �3��chkii:�(q%!24�&100)=0�1,"Icon not indirected" �� � �<��geti(h%,i%):!q%=h%:q%!4=i%:ș"Wimp_GetIconState",,q%:� � .ݤta(h%):!q%=h%:ș"Wimp_GetWindowInfo",,q% ,�(q%!60�&100)=0�1,"Title not indirected" =q%!76 $ .��stop(r%,T$,U$) 8dialreason%=r%:stopfile%=T% B#�-3��stopboxes%:mi%=3:�mstop:� L+�seti(w_stop%,0,T$):�seti(w_stop%,1,U$) V)�unselall(w_stop%):�dialogue(w_stop%) `dialreason%=r%:stopfile%=T% j� t ~��dialogue(h%) ��X%,Y%:�nodial �'ș "Wimp_GetCaretPosition",,dialct% �=dialfile%=file%:�nomenu:�readpointer:X%=mx%-200:Y%=my%-85 � �X%<0X%=0 ��Y%<96Y%=96 �2dialogue%=h%:�front(h%,X%,Y%):�setct(h%,-1,-1) ���D\p:� �;�readh(h%):�h%=dialogue%:�X%:�setct(h%,X%,�$�ia(h%,X%)) ��h%<>-1:�:�X%:�X%<-1:h%=0 ��h%=dialogue%�h%<0:� � �!��readpointer:�q%:q%=workbuf% ș"Wimp_GetPointerInfo",,q% 1mx%=!q%:my%=q%!4:mb%=q%!8:mh%=q%!12:mi%=q%!16 � (ݤdialogue:�file% 26�dialogue%>=0�mh%<>dialogue%�mh%<>w_shadow%�nodial <=� F P$��mouse(mx%,my%,mb%,mh%,mi%,mo%) Z�dragreason%>=0�mb%>255:� d7�wtof(mh%):�file%>=0�wind%=4�(mb%=1�mb%=4)�mi%<19:� n�mb%<16:�dialogue:� x3w_info%=w_pinfo%:�mb%=7:mb%=2:w_info%=w_pinfo2% � Ȏmb%� ��2:�menu ��1,4:�select ��16,64:�startdrag �� �� � �6��seti(h%,i%,T$):T$=�T$,�il(h%,i%)):$�ia(h%,i%)=T$ �<�iconupd(h%,i%):�getct:�!q%=h%�q%!4=i%:�setct(h%,i%,�T$) �� � �'��iset(h%,i%,B%,E%):�q%:q%=workbuf% �?!q%=h%:q%!4=i%:q%!12=B%:q%!8=E%:ș"Wimp_SetIconState",,q%:� '��iconupd(h%,i%):�iset(h%,i%,0,0):� "��force(h%) , Ȏh%� 6.ș"Wimp_ForceRedraw",h%,-1E9,-1E9,1E9,1E9 @� J� T ^��readblock(p%) h'x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12 r(scx%=p%!16:scy%=p%!20:bhandle%=p%!24 |bx%=x0%-scx%:by%=y1%-scy% �/ex0%=p%!40:ey0%=p%!44:ex1%=p%!48:ey1%=p%!52 �/gx0%=p%!24:gy0%=p%!28:gx1%=p%!32:gy1%=p%!36 �open%=(p%!28�&10000)<>0 �� � ���getw(h%) �%!q%=h%:ș"Wimp_GetWindowInfo",,q% ��readblock(q%+4) �� � ���select ��file%>=0� �Ȏwind%� �1:�msubs �3:�msortw � &� 0 Ȏmh%� :*�-2:�mb%=1��-1��-2:�oscli(""):��status D�w_stop%:�mstop N�w_save%:�msave X�w_status%:�mstatus b$�w_mess%:�mi%=6:�closew(w_mess%) l�w_sort%:�msort v�w_open%:�mopen ��w_sortex%:�mexpr �� �� �� � ���msort ��mi%=3��v_(1)>0�err(302) ��mi%=3:�closew(w_sort%):� ��mi%=4��v_(1)=0:�err(303) �!�mi%=-1:�front(w_sort%,-1,-1) � �mi%<>4:� �2startsort%=�:�newdelay:�front(w_sort%,-1,-1):� �� ��msubs %�T%:T%=�itos:�T%>=0:�selsub(T%):� � * 4��msortw > �expr H� R \#��mopen:�mi%=11�closew(w_open%) f �mi%<>12� p�I%,m%,d%,r%,p$ z.p$=$�ia(w_open%,14):�wchi(w_open%):I%=q%:� ��!I%=0:d%=� ��!I%>0�!I%<9:m%=!I%-1 ��!I%=16:r%=� �:I%+=4:�I%!-4<0:file$=$�ia(w_open%,13):�closew(w_open%) �#�opensort1(file$,m%,d%,p$,r%):� � ���mexpr �5�A%,T$,a%,c%,s%,u%,I%,Q%,B%:�unseli(w_sortex%,29) �+A%=�ia(w_sortex%,17):�qbscan($A%,Q%,B%) � Ȏmi%� ��2,3,4,5,6,7,8,9 �>�$A%>""��Q%$sd%=�"+-*/=<><()",mi%-1,1):�$sd%<>�$A%)T$=$sd% ��mi%=7:�T$>"":T$+=">" �seti(w_sortex%,17,$A%+T$) �10,11 P�(($A%>""�B%>0)�mi%=10)��Q%:$sd%=�"()",mi%-9,1):�seti(w_sortex%,17,$A%+$sd%) $ �12,13 .T$=$A%:�$A%>""��Q%� 8$sd%=�$A%):șswi%,upper_% B7�($sd%>="A"�$sd%<="Z")�($sd%>="0"�$sd%<="9")T$+=" " L�mi%=12T$+="AND"�T$+="OR" V� `�seti(w_sortex%,17,T$) jV�14:�$A%>""��Q%T$=$A%+"=""**""":�seti(w_sortex%,17,T$):�setct(w_sortex%,17,�$A%-2) tU�15:�$A%>""��Q%T$=$A%+"~=""""":�seti(w_sortex%,17,T$):�setct(w_sortex%,17,�$A%-1) ~�20,21:�subs ��22:�nodial �F�29:�$A%=""�seti(w_sortex%,17,ex$):�ex$=$A%:�seti(w_sortex%,17,"") ��23 ��wchi(w_sortex%):I%=q%:� � Ȏ!I%� ��1:s%=� ��0:u%=� ��19:a%=� ��28:c%=� �� �I%+=4:�I%!-4=-1 ��u%:�upplit($A%) �seti(w_sortex%,17,$A%) o%(0,0)=(s%�4)�(u%�2)�(a%�1) #T$=�x1($A%):o$(0)=$A%:ox$(0)=T$ !�nodial:�w%(3)>0�force(w%(3)) (� 2�iconupd(w_sortex%,17) <� F P��mstop:�mi%<3�mi%>4� Z%�T%:T%=dialreason%:dialreason%=-1 d�mi%=3� n�closew(w_stop%) x ȎT%� � �2:closeok%=�:�closew(w%(0)) ��6:�CLOSE:�quit(�) ��14:�loadnotes ��17:�clearnpad ��20:stopboxes%=� �+�36:�"*settype "+file$+" "+�~menufield% �D�menufield%=ft_data%:�checkopen:�mstore("3:"+file$,"MultiStore") ��38:�picpath �� �� ��T%=1:�CLOSE:�quit(�) �� ��closew(w_stop%):� ��msave �mi%<>0� "0�T$:T$=$�ia(w_save%,2):�T$=�leaf(T$):�err(5) ,1savetype%=savet%:task%=-1:file$=T$:�savedata1 6� @ J ��mstatus T �T%,I%,A% ^ Ȏmi%� h$�15:�w%(0)>0:�front(w%(0),-1,-1) r�12 |�13 �sound%=�:shadows%=�:pix%=� ��wchi(w_status%):I%=q%:� � Ȏ!I%� ��24:sound%=� ��25:shadows%=� ��23:A%=� ��28:pix%=� �� �I%+=4:�I%!-4<0 �1�sound%:șswi%,opt_%,10�G%:�șswi%,opt_%,9�G% ��A%<>stopboxes%� �C�A%stopboxes%=�:��stop(20,rl$+"disable these","stop boxes ?"):� �� � � �closew(w_status%):� & 0��startdrag :"dragreason%=-1:dragbutton%=mb% D�wtof(mh%):�file%>=0� NȎwind%� X�0 b\�mb%=16dragreason%=4:�dragcard:�menufield%=�mousef:�menufield%>0dragreason%=3:�dragfield l�1 v@menusub%=�itos:�menusub%>=0:dragreason%=2:�dragicon(mh%,mi%) ��2 �0menufield%=my%:�yconv(menufield%,�v_(7),mh%) �dragreason%=3:�dragfield1 �>�4:�mi%<19:dragreason%=6:menufield%=mi%:�dragicon(mh%,mi%) �� �� � Ȏmh%� �6�w_save%:�mi%=3:dragreason%=5:�dragicon(w_save%,3) �� �� �� � � ��enddrag !�readpointer ! �mh%<>-1� !�T$ ! Ȏdragreason%� !*�1:�carddr !4�2:�subsdr !>�3:�fielddr !H�4:�carddr1 !RA�5:�savereq(�leaf($�ia(w_save%,2)),savet%,saves%,savereason%) !\�6:�enternote !f� !p� !z�dragreason%=4:�carddr1 !�� !�dragreason%=-1:menufile%=-1 !�� !� !�,��unseli(h%,i%):�iset(h%,i%,&200000,0):� !� !�0��seli(h%,i%):�iset(h%,i%,&200000,&200000):� !�2��shadei(h%,i%):�iset(h%,i%,&400000,&400000):� !� !���unselall(h%) !��I%,i%:�wchi(h%) !�(I%=q%:�:i%=!I%:�i%>=0:�unseli(h%,i%) !�I%+=4:�i%<0:� " "7��wchi(h%):ș"Wimp_WhichIcon",h%,q%,&200000,&200000 "� "$ ". ��menu "8�wtof(mh%):�file%>=0� "BȎwind%� "L�0:�cardmenu "V�3:�msortw "`�4:�pop(m_npad%,-1) "j� "t� "~ Ȏmh%� "�$�-2:my%=64+7*44:�pop(m_main%,-1) "�� "�� "�� "� "�!��cardmenu:�pop(m_card%,-1):� "� "�ݤpar(t$,s$,� i%):�i1% "�i1%=i%+1:i%=�t$+s$,s$,i1%) "�=�t$,i1%,i%-i1%) "� "�ݤcrmenu(menu$) # .�menufree%+28>menuend%�99,"Menu area full" # � m% #menuptr%=menufree% #i%=0 #(C� �menu$,1)="#"i%=1:menutitle$=�par(menu$,",",i%)�menutitle$="" #2$menuptr%=menutitle$ #<;menuptr%?12=7:menuptr%?13=2:menuptr%?14=7:menuptr%?15=0 #F3menuptr%!16=196-24:menuptr%!20=44:menuptr%!24=0 #P"menuptr%+=28:maxx%=�menutitle$ #Z�item$=�par(menu$,",",i%) #d�menuitem(item$) #n� item$="" #x$m%=menufree%:m%!16=(maxx%*8+6)*2 #�menufree%=menuptr% #�=m% #� #���menuitem(text$) #�.�text$=""menuptr%!-24=(menuptr%!-24)�&80:� #�.�menuptr%+24>menuend%��99,"Menu area full" #��i%,flg% #�flg%=&00 #�i%=�text$,">") #�<�i%>0subptr%=��text$,i%+1):text$=�text$,i%-1)�subptr%=-1 #�i%=�text$,"}") #�;�i%>0subptr%=��text$,i%+1):text$=�text$,i%-1):flg%+=&08 #�)��text$,1)="#"text$=�text$):flg%+=&02 $;menuptr%!0=flg%:menuptr%!4=subptr%:menuptr%!8=&07000021 $�text$,1)="$"� $2!menuptr%+=&04:menuptr%!8+=&100:i%=�text$,"(") $"3�i%>0�L%=��text$,i%+1):text$=�text$,i%-1)�L%=12 $,8menuptr%!12=��text$,2):menuptr%!16=-1:menuptr%!20=L% $6text$=�L%," ") $@� $J�text$<=12� $T$(menuptr%+12)=text$ $^� $h%I%=�workspace(�text$+1):$I%=text$ $r6menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=�text$+1 $| menuptr%!8=menuptr%!8 � &100 $�� $��text$>maxx%maxx%=�text$ $�� $�menuptr%+=24 $�� $� $�ݤworkspace(L%) $�2� curbuf%+L%>endbuf%�99,"No more buffer space" $�curbuf%+=L%:=curbuf%-L% $� $���prep(menu%,tree%) $��I%,T$:�clearts(menu%) $�Ȏmenu%� %�m_main%:�mp_main %�m_file%:�mp_file %�m_wind%:�mp_wind %&�m_card%:�mp_card %0�m_npad%:�mp_npad %:� %D� %N %X ��mp_card %b�prep(m_wind%,tree%) %l� %v %� ��mp_file %�� %� %� ��mp_wind %��w%(1)>0�tick(menu%,0) %��w%(2)>0�tick(menu%,1) %��w%(3)>0�tick(menu%,2) %��w%(4)>0�tick(menu%,3) %�� %� %� ��mp_npad %� �saveset(f_np$,&FFF,5,80*19) %�� & & ��mp_main &M�v_(1)>0:�shade(menu%,1):�shade(menu%,2):�shade(menu%,3):�shade(menu%,5) & �w_sort%>0�tick(menu%,2) &*� &4 &>$��pop(menu%,tree%):�process%>0:� &H�menu%<0:� &R�prep(menu%,tree%) &\,ș"Wimp_CreateMenu",,menu%,mx%-50,my%+32 &fopenmenu%=menu% &p� &z &���nomenu &�(ș"Wimp_CreateMenu",,-1:openmenu%=-1 &�� &� &�+��nodial:�dialogue%>0�closew(dialogue%) &�� &� &���menuselect &��I% &�-I%=0:�mlist%!I%=q%!I%:I%+=4:�q%!(I%-4)=-1 &��readpointer &�Ȏopenmenu%� &��m_main%:�m_main '�m_card%:�m_card '�m_npad%:�m_npad '� '$�mb%=1� '.#�pop(openmenu%,mlist%):��nomenu '8� 'B� 'L� 'V '`��m_npad 'jȎ!mlist%� 't4�0:�stop(17,fi$+�filename,rl$+"clear notepad ?") '~� '�� '� '���m_main '�Ȏ!mlist%� '��0:�dialogue(w_info%) '��1:�transfer '��2:�fastsort '��3:�create '��4:�status '��5:�pdriver '�!�6:�v_(1)=0:�quit(�):��qquit '�� ( � ( (��m_card (Ȏ!mlist%� ((�0:�m_file (2�1:�m_wind (<� (F� (P (Z��m_wind (d�T%:T%=mlist%!4 (n5�T%>-1�T%<maxw%-1:�w%(T%+1)>0:�closew(w%(T%+1)):� (x ȎT%� (��0:�subs (��1:�fieldlist (� �2:�sortw (��3:�notepad (� �4:�wtidy (�� (�� (� (���m_file (�Ȏmlist%!4� (�,�0:�CLOSE:�mstore("2:"+fn$,"MultiStore") (�� (�� ) )��submenu(menu%,X%,Y%,q%) )�I% )"-I%=0:�mlist%!I%=q%!I%:I%+=4:�q%!(I%-4)=-1 ),�prep(openmenu%,mlist%) )6'ș"Wimp_CreateSubMenu",,menu%,X%,Y% )@� )J )T ��clearts(mh%):�I%:I%=mh%+28 )^"�mh%<menustart%�mh%>menuend%:� )h� )r"!I%=!I%��1:I%!8=I%!8��&400000: )|I%+=24:�I%!-24�&80 )�� )� )���shade(mh%,I%) )�/mh%!(28+8+24*I%)=mh%!(28+8+24*I%)�&400000:� )� )���tick(mh%,I%) )�'mh%!(28+24*I%)=mh%!(28+24*I%)�&01:� )� )���redraw(update%) )��h%,T%:�update%� )�%ș"Wimp_UpdateWindow",,q% � more% )�� )�%ș"Wimp_RedrawWindow",,q% � more% *� *%h%=!q%:�wtof(h%):�readblock(q%+4) *ȕ more% *&T%=�:�:��:T%=� *0�T%� *:"�-3:�rectfill(�$):���:�err(0) *D� *N�file%>=0� *XȎwind%� *b�0:�drawcard *l�2:�drawflist *v�3:�drawsort *�� *�� *�� *�� *��� *�!q%=h%:more%=�nextrectangle *�� *�� *� *���drawcard *�+�T%:�update%T%=6:�șswi%,gline_%:�:T%=2 *�*�gcol(0,7):�gcol(0,130+��flg(f_7bit%)) *�-�bx%+margin%,by%-margin%:șswi%,wimp_%,T% +� + +9��drawflist:�T%,X%,Y%,x%,y%:T%=&10000:�update%T%=T%�1 + 2�v_(7)=0�rectfill("No fields in this file"):� +*/�bx%+margin%,by%-margin%-4:șswi%,wimp_%,T% +4� +> +H��drawsort:�update%� +R6�Y%,T%,d%,L%:d%=�v_(14):L%=(gx1%-bx%-margin%)�16+1 +\� +f0��:��:șswi%,grec_%,0:�force(w%(3)):�err(0) +p?T%=(by%-gy1%-margin%-4)�linegap%:Y%=by%-margin%-linegap%*T% +z)ȕY%>=gy0%�T%<�v_(17):�bx%+margin%,Y% +��rlin(T%+1,L%) +�+T%+=1:Y%-=linegap%:�:șswi%,grec_%,0�N% +�� +� +�ݤrlin(r%,L%):�t$,a$ +�#a$=�12," "):șswi%,grec_%,r%�N% +�%�sd35:a$=�a$+�(r%),10)+": ":ȎG%� +�+�1:�gcol(0,3):t$="(Not in this subset)" +�"�0:�gcol(0,7):�L%>11:t$=�rlin1 +�$:�gcol(0,3):t$="(Deleted Card)" +�� +�=�a$+t$,L%) +� ,ݤrlin1 ,�:��:��:=" ** "+�$ ,*=�ev3(ox$(0),o%(0,0)�4,o%(0,0)�2,&90A) ,$ ,.4ݤnextrectangle:�T%:ș"Wimp_GetRectangle",,q%�T% ,8�readblock(q%+4):=T% ,B ,L��rectfill(T$) ,V�gcol(0,3):�I%,J%,L%,X%,Y% ,`L%=�T$*16+48 ,j,X%=bx%+margin%:J%=gx0%-X%:X%=X%-J%+J%�L% ,t=J%=by%-gy1%-margin%:J%=J%-J%�linegap%:Y%=by%-margin%-4-J% ,~�J%=Y%�gy0%�-linegap% ,�%�X%,J%:�I%=X%�gx1%�L%:�T$" - ";:� ,��:� ,� ,���waitpoint ,�waiter%+=1 ,�ș"Hourglass_On" ,�� ,� ,���normpoint ,�8ȕwaiter%>0:ș"Hourglass_Off":waiter%-=1:�:waiter%=0 ,�� ,� - ��gcol(m%,c%) - !ș"Wimp_SetColour",(m%<<4)+c% -� - -(��dataloadack -2!q%=20:q%!12=ref%:q%!16=4 -<$ș"Wimp_SendMessage",17,q%,task% -F� -P -Z��datasaveack -d<�ArfVar("Wimp$Scrap")="":�99,"<Wimp$Scrap> not defined" -nA!q%=60:q%!12=ref%:q%!16=2:q%!36=-1:$(q%+44)="<Wimp$Scrap>"+�0 -x1ș"Wimp_SendMessage",17,q%,task%:ackref%=q%!8 -�� -� -���savereq(T$,t%,s%,r%) -�:savereason%=r%:q%!32=my%:q%!28=mx%:q%!24=mi%:q%!20=mh% -�8q%!16=1:q%!12=0:q%!36=s%:q%!40=t%:!q%=(�T$+53)�&FFFC -�9$(q%+44)=T$+�5,�0):ș"Wimp_SendMessage",17,q%,mh%,mi% -� saveref%=q%!8:savetype%=t%:� -� -�&��loadmess:�readpointer:�task%<0:� -�+$(q%+44)=file$+�0:!q%=(�file$+49)�&FFFC -�&q%!12=ref%:q%!16=3:q%!40=savetype% -�?q%!20=mh%:q%!24=mi%:q%!28=mx%:q%!32=my%:q%!36=�fsize(file$) -�$ș"Wimp_SendMessage",17,q%,task% .ackpending%=�:� . .&ݤfsize(T$):�T%,s%:T%=�T$:�T%=0:=0 ."s%=�#T%:�#T%:=s% ., .6ݤzts(T%):�T$ .@ȕ?T%<>0:T$+=�?T%:T%+=1:� .J=T$ .T .^)��key(h%,icon%,x%,y%,carh%,off%,key%) .h�F%:F%=� .rȎkey%� .|�9,&18A:�findct .��13:�cursor(h%,icon%,1,0) .��19:�swapcase .�"�27:�dialogue%>=0�nodial:�F%=� .��&181:笤prod:�quit(�) .�#�&18F:�cursor(h%,icon%,-1,off%) .�"�&18E:�cursor(h%,icon%,1,off%) .�#�&19F:�cursor(h%,icon%,-5,off%) .�"�&19E:�cursor(h%,icon%,5,off%) .�(�&1AF,30:�cursor(h%,icon%,-1E9,off%) .�$�&1AE:�cursor(h%,icon%,1E9,off%) .� F%=� .�� .� �F%:� /ș"Wimp_ProcessKey",key% /� / /&,��swapcase:�getct:T%=q%!20+�ia(!q%,q%!4) /03�?T%<123�?T%>96 ?T%-=32:��?T%<91�?T%>64 ?T%+=32 /:*�getct:�?T%>31�setct(!q%,q%!4,q%!20+1) /D�getct:�iconupd(!q%,q%!4):� /N /X+��getct:ș"Wimp_GetCaretPosition",,q%:� /b /l=��setct(h%,i%,o%):ș"Wimp_SetCaretPosition",h%,i%,,,-1,o% /v�i%>=0�findct /�� /� /���cursor(h%,i%,s%,o%) /� ��D\p /� �W%,T$,I% /�ȕW%<>-1 /��readh(W%):�W%<>h%� /��W%<>-1:�:�W%:�W%<-1:W%=0 /�� /�� /��W%:�W%<>-1:T$+=�(W%) /��W%<-1:T$=�T$) /�;�key%=13:��T$)=i%:mi%=�(W%+100):mb%=1:mh%=h%:�select:� 0/�s%=1E9:s%=�T$:��s%=-1E9:s%=1:�s%+=�T$,�i%) 0ȕs%>�T$:s%-=�T$:� 0ȕs%<1:s%+=�T$:� 0 I%=��T$,s%) 0*#�o%>�$�ia(h%,I%)o%=�$�ia(h%,I%) 04�setct(h%,I%,o%) 0>� 0H� 0R� 0\�w_save%,2,-100 0f�w_open%,14,-112 0p�w_sortex%,17,-123 0z@�"w%(4)",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,-100 0��-1 0� 0�ݤleaf(T$) 0� �I%,C% 0�$�((�T$,".")=0)�(�T$,":")=0))�=T$ 0�I%=�(T$) 0�� 0�C%=��T$,I%,1) 0� I%-=1 0��(I%<=0�C%=�"."�C%=�":") 0��I%>0�=�T$,�(T$)-I%-1) 0�=T$ 0� 13��wext(h%,x%,y%):!q%=0:q%!4=-y%:q%!8=x%:q%!12=0 1'ș"Wimp_SetExtent",h%,q%:�force(h%) 1�getw(h%):�open%� 1$�x1%-x0%>x%:x%+=x0%:�x%=x1% 1.!�y1%-y0%>y%:y%=y1%-y%:�y%=y0% 18.�open(h%,x0%,y%,x%,y1%,scx%,scy%,bhandle%) 1B� 1L� 1V 1` ��process 1j/�dialreason%>=0�dialogue%>=0�ackpending%>0� 1tȎprocess%� 1~�1:�checkprot 1�Q�2:�stop(1,"Please place original","MultiStore disk in drive :0"):process%+=1 1��3:�checkprot 1��4:�fastsort:�startopen 1�process%=0 1�� 1� �newdelay 1�� 1� 1���dragicon(h%,i%) 1�"�x%,y%,ys%,tx0%,ty0%,tx1%,ty1% 1�,�getw(h%):ys%=y1%-y0%:x%=bx%:y%=y0%-scy% 1�1�geti(h%,i%):q%!8+=x%:q%!12+=y%+ys%:q%!16+=x% 2 0q%!20+=y%+ys%:q%!24=0:q%!28=0:!q%=0:�drag5:� 2 2<��drag5:�readpointer:�scrsz:tx0%=mx%-q%!8:ty0%=my%-q%!12 2=q%!24-=tx0%:q%!28-=ty0%:q%!32+=q%!16-mx%:q%!36+=q%!20-my% 2(!q%!4=5:ș"Wimp_DragBox",,q%:� 22 2<ݤlower(T$):�T$="":="" 2F �I%,C% 2P�I%=1��T$:C%=��T$,I%) 2Z"�C%>64�C%<91�T$,I%,1)=�(C%+32) 2d �:=T$ 2n 2x$��wtof(T%):�J%:wind%=-1:file%=-1 2�-�J%=0�maxw%:�w%(J%)=T%:file%=0:wind%=J%:� 2��:� 2� 2� ��fext 2� �x%,y% 2�y%=�ht*linegap%+margin%*2 2�)x%=�wd*16+margin%*2:�x%<22*16x%=22*16 2�>!q%=0:q%!4=-y%:q%!8=x%:q%!12=0:ș"Wimp_SetExtent",w%(0),q% 2��getw(w%(0)) 2��x1%-x0%>x%:x%+=x0%:�x%=x1% 2�!�y1%-y0%>y%:y%=y1%-y%:�y%=y0% 2�1�open(w%(0),x0%,y%,x%,y1%,scx%,scy%,bhandle%) 2�� 3 3"ݤht:șswi%,sd57_%,"height"�G% 3!ݤwd:șswi%,sd57_%,"width"�G% 3"=G% 3, 36*ݤbadrec(T%):=(T%�&7FFFFF00)=&7FFFFF00 3@ 3J��startopen 3T%T$=�ArfVar("MultiStore$Function") 3^ Ȏ�T$� 3h"�1:�opensort1(�T$,3),7,0,"",0) 3r� 3|*unset MultiStore$Function 3�process%+=1:� 3� 3���ready 3�� 3� 3� ��closeok 3�'�stop(2,"","Close file "+�filename) 3�� 3� 3�ݤfilename 3�șswi%,stat_%�G% 3�=¤leaf($sd%),10) 3� 4$ݤhdbyte(T%):șswi%,sd13_%,T%�G% 4%ݤhdbyte1(T%):șswi%,sd13_%,T%�G% 4=G% 4& 40��qbscan(T$,� Q%,� B%) 4:*�I%,T%:Q%=�:B%=0:�I%=1��T$:T%=��T$,I%) 4D�T%=34:Q%=�Q% 4N �Q%� 4X"�T%=�"(":B%+=1:��T%=�")":B%-=1 4b� 4l�:� 4v 4�&��fieldlist:�w%(2)<=0:�makeflist:� 4��front(w%(2),-1,-1):� 4� 4�=��delicon(h%,i%):!q%=h%:q%!4=i%:ș"Wimp_DeleteIcon",,q%:� 4� 4�2��loseicon(h%,i%):�geti(h%,i%):�delicon(h%,i%) 4�7q%!4=!q%:q%!8=-1E9:q%!12=-1E9:q%!16=-1E9:q%!20=-1E9 4�ș"Wimp_CreateIcon",,q%+4:� 4� 4���carddr 4��wtof(mh%):�file%>=0� 4�Ȏwind%� 4�� 5� 5 Ȏmh%� 5%:�savereq("Card",&FFF,�wd*�ht,1) 5 � 5*� 54� 5> 5H ��carddr1 5R+tx0%=!q%:tx1%=q%!8:ty0%=q%!4:ty1%=q%!12 5\4�(tx0%-tx1%)<10��(ty0%-ty1%)<10:mb%=1:�select:� 5f;�cxconv(tx0%):�cxconv(tx1%):�cyconv(ty0%):�cyconv(ty1%) 5p�tx0%>tx1%:Ȕtx0%,tx1% 5z�ty0%>ty1%:Ȕty0%,ty1% 5�4�savew(f_cd$,&FFF,2,(tx1%-tx0%+1)*(ty1%-ty0%+1)) 5�� 5� 5���fielddr:�X%,Y% 5��wtof(mh%):�file%>=0� 5�Ȏwind%� 5�6�3:�msortw:�seti(w_sortex%,17,�fname1(menufield%)) 5�:�enterfield 5�� 5�� 5��enterfield 5�� 5�� 6 6!��savedata:�q%!12<>saveref%:� 6file$=�zts(q%+44) 6$�savedata1:� 6. 68 ��savedata1:�closew(w_save%) 6B,outfile%=0:outfile%=�file$:�outfile%=0:� 6L� 6V��:��:�#outfile%:�err(0) 6`Ȏsavereason%� 6j�5:�savenotes 6t� 6~��:�#outfile% 6�/�"settype "+file$+" "+�~savetype%:�loadmess 6�savereason%=-1:�nomenu 6�� 6� 6�ݤmousef 6�0�X%,Y%:X%=mx%:Y%=my%:�cyconv(Y%):�cxconv(X%) 6� �:��:=0 6�șswi%,sd52_%,X%,Y%�G% 6�=G% 6� 6�$��dragfield:�fieldsz(menufield%) 6�9!q%=w%(0):q%!8=bx%+tx0%:q%!12=by%+ty0%:q%!16=bx%+tx1% 7 2q%!20=by%+ty1%:q%!24=0:q%!28=0:q%!4=5:�drag5:� 7 7��dragfield1:�Y% 7<�getw(w%(2)):Y%=by%-menufield%*linegap%-margin%+linegap% 7(Aq%!8=bx%+margin%:!q%=w%(2):q%!12=Y%-32:q%!16=bx%+ex1%-margin% 72,q%!20=Y%:q%!24=0:q%!28=0:q%!4=5:�drag5:� 7< 7F��dragcard:�dialogue:� 7P!q%=w%(0):�getw(!q%) 7Z*q%!8=mx%:q%!12=my%:q%!16=mx%:q%!20=my% 7d>q%!24=bx%+ex0%+margin%:q%!28=by%+ey1%-margin%-�ht*linegap% 7n!q%!32=bx%+ex0%+margin%+�wd*16 7x6q%!36=by%+ey1%-margin%:q%!4=6:ș"Wimp_DragBox",,q% 7�� 7� 7�)��cxconv(� X%):�xconv(X%,�wd,w%(0)):� 7�)��cyconv(� Y%):�yconv(Y%,�ht,w%(0)):� 7� 7�!��yconv(� Y%,T%,h%):�getw(h%) 7�8Y%=(by%-Y%-margin%)�linegap%+1:�Y%<1Y%=1��Y%>T%Y%=T% 7�� 7� 7�!��xconv(� X%,T%,h%):�getw(h%) 7�2X%=(X%-bx%-margin%)�16+1:�X%<1X%=1��X%>T%X%=T% 7�� 7� 8��savew(f$,T%,r%,s%) 8�saveset(f$,T%,r%,s%) 8�dialogue(w_save%):� 8" 8,��saveset(f$,T%,r%,s%) 86&savereason%=r%:savet%=T%:saves%=s% 8@>�seti(w_save%,2,f$):$�va(w_save%,3)="sfile_"+�"00"+�~T%,3) 8J� 8T 8^��CLOSE 8h#�v_(1)>0:closeok%=�:�closefile 8r� 8| 8� ��prequit 8��v_(1)>0�ackrec:�qquit 8�� 8� 8�8��ackrec:q%!12=ref%:ș"Wimp_SendMessage",19,q%,task% 8�/��qquit:�stop(6,"Close files and quit",as$) 8�� 8� 8�%ݤfname(T%):șswi%,sd17_%,9,T%�G% 8� =$sd% 8� 8�3ݤfname1(T%):�T%<0:="N%":�șswi%,sd17_%,4,T%�G% 8�.�(G%�7)=7:="@"+�fname(T%):�="#"+�fname(T%) 9 9���ass:�L%,I%,A%:�L%50:�I%=0�1:P%=L%:[opt I%*2:.search%:mov 5,#&FF:add 5,5,#&FF00:and 2,2,5:mul 9,0,3:sub 3,3,#1:add 8,1,9:.A%:ldrb 4,[8],#1:ldrb 9,[8],3:orr 4,4,9,asl #8:cmp 4,2:add 0,0,#1:bne A%:mov 15,14:]:�:� 9 9&/��flg(T%,F%):flg%=(flg%��T%)�((F%<>0)�T%):� 90ݤflg(T%)=(flg%�T%)<>0 9: 9D ݤx1(T$):�:��:��:�err(306) 9N=�x(T$) 9X 9b&ݤx(A$):�strip(A$):�A$="":�err(35) 9l;�Q%,B%,I%,z$:�qbscan(A$,Q%,B%):�Q%�err(10):��B%�err(11) 9v z$=A$:ȕ�z$,"'"):I%=�z$,"'") 9�J%=(��z$,I%+1))�&DF 9��J%<65�J%>83:�err(29) 9�*�z$+�$�tia(tw%(4),J%-65)>250:�err(30) 9�.z$=�z$,I%-1)+$�tia(tw%(4),J%-65)+�z$,I%+2) 9�/�:A$=�X(z$):�strip(A$):�A$="":�err(35):�=A$ 9� 9�ݤX(A$):�z$,J%,I%:z$=A$ 9� ȕ�A$,"=""*"):I%=�A$,"=""*") 9� z$=�A$,I%-1)+","""+�A$,I%+3) 9�#J%=�z$,�34,I%+2):�J%=0:�err(10) 9�/�z$,J%-1,1)="*":z$=�z$,J%-2)+�z$,J%):J%-=1 9�"z$=�z$,J%)+")"+�z$,J%+1):J%=I% 9��:I%=I%-1:�I%<0:�err(31) :��z$,I%,1)="@" :z$=�z$,I%-1)+"FNi("+�z$,I%) :A$=z$:�:=A$ : :*ݤev(A$,s%,u%) :4$sd%="N":�s%$sd%+="S" :>�u%$sd%+="U" :Hșswi%,expand_%,A$,$sd% :R$R%=�v_(17):D%=�v_(14):N%=�v_(15) :\ =�$sd% :f :pݤev3(A$,s%,u%,A%) :z �U%:� :�%��:��:@%=&90A:U%=�:�<>6:�err(0) :��U%� :�$sd%=�ev(A$,s%,u%) :�� :�4@%=A%:$sd%=�" "+äev(A$,s%,u%),15) :��s%:șswi%,strip_% :�� :�@%=&90A:=$sd% :� :���wtidy :�,�I%:�I%=2�maxw%:�w%(I%)>0�closew(w%(I%)) :��:� :� ;*��scrollto(X%,Y%,h%):�h%<0�:��getw(h%) ;8�X%>=x0%-bx%�X%<=x1%-bx%�Y%<=y1%-by%-32�Y%>=y0%-by%� ;,scx%=X%-(x1%-x0%)�2:scy%=�Y%-(y1%-y0%)�2 ;$�scx%<0scx%=0 ;.�scy%<0scy%=0 ;81�open(h%,x0%,y0%,x1%,y1%,scx%,-scy%,bhandle%) ;B� ;L ;V/��findct:�getct:�scrollto(q%!8,q%!12,!q%):� ;` ;j*��status:w_status%=�crwind(tw_status%) ;t�I%,T%,T$,s$:s$=�12," ") ;~�unselall(w_status%):T%=0 ;��v_(1)>0� ;�T$=��filename+�11," "),11) ;�3T$+=�s$+äv_(16),10)+�s$+äv_(17),11)+" (SORT)" ;�)�T%<8:�seti(w_status%,T%+15,T$):T%+=1 ;�� ;�,ȕT%<8:�seti(w_status%,T%+15,""):T%+=1:� ;�#�stopboxes%:�seli(w_status%,23) ;��sound%:�seli(w_status%,24) ;�!�shadows%:�seli(w_status%,25) ;��pix%:�seli(w_status%,28) ;�$�sprsz%<=0:�shadei(w_status%,28) ;��dialogue(w_status%):� <