Home » Personal collection » Acorn hard disk » apps » MultiStore » !MultiStor/MSTransfer
!MultiStor/MSTransfer
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/MSTransfer |
Read OK: | ✔ |
File size: | 1519E bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM> <MultiStore$Dir>.MSTransfer 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 320WHEN10 330WHEN11 340WHEN12 350WHEN17,18:PROCumess1 360WHEN19:PROCumess2 370ENDCASE 380PROCnormpoint 390ENDPROC 400 410DEFPROCquit(T%):PROCnormpoint:PROCnovars 420IFNOT(INKEY-3ANDFNdebug):$q%="TASK":SYS"Wimp_CloseDown",taskhandle%,!q% 430IFT%ORFNdebug:PROCtidy:END 440SYSswi%,killtask_%,taskhandle% 450QUIT 460 470DEFFNtask=otask% 480 490DEFPROCinit:otask%=Z%:PROCswinums 500appl$="MultiStore":pstream%=0:PROCreleasepr 510DIM q% 2500, workbuf% 1500,dialct% 24 520waiter%=0:file%=-1:v%=FNinitwimp:IFv%<180:MODE12:PROCerr(2) 530PROCwaitpoint:LIBRARY(FNdir+"BaseLib") 540LIBRARY(FNdir+"SwiList"):PROCswilist 550quit%=FALSE:dialreason%=-1:dialogue%=-1:dialfile%=-1 560ackpending%=FALSE:ackref%=-1 570dragreason%=-1:help$="" 580savereason%=-1:savefile%=-1 590file2%=-1:reason2%=-1 600menufile%=-1:menusub%=-1 610closeok%=FALSE 620sbfile%=-1:pass$="" 630pdriver%=TRUE:SYS"OS_Byte",182,0,255 TO,pterm% 631IF(pterm%AND&80)=0SYS"OS_Byte",246,0,255TO,pterm% 640IFpterm%=10pterm%=1:ELSEpterm%=2 650id_wcia%=42:id_exb%=43:id_bbc%=0 660exi0%=-1:exi1%=-1:links%=0 670DIM edbuf% 256,edval% 15 680edfield%=-1:edfile%=-1:edicon%=-1:edrec%=-1:edx%=-1:$edval%="a0-9\-+." 690ss%=12:lc%=3:PROCreadparams:PROCfilevars 700PROCloadsprites:PROCdefws:PROCdefmenus:PROCversion 710process%=1:checkref%=-1:delay%=0 720stopfile%=-1:lastact%=0:chunk%=7 730as$="Are you sure ?":rl$="Really ":ri$=rl$+"interrupt ?":fi$="File: " 740sy$="Sorry! ":lastspr$="":copying%=0 750source%=0:target%=1:tcd%=TRUE:tws%=TRUE:tns%=TRUE:tsb%=TRUE:expfield%=0 760VDU23,255,0,126,126,126,126,126,126,0 770PROCbaricon:ENDPROC 780 790DEFPROCswinums 800charswi%=&C0000 810ENDPROC 820 830DEFPROCfilevars 840REM ;{n 850REM ;{n window handles in w%(maxf%,maxw%) - <=0 = Deleted 860REM ;{n (,0)=Card (,1)=Pane (,2)=Subsets (,3)=Report 870REM ;{n (,4)=Fields (,5)=Indices (,6)=Notepad (,7)=Macro 880REM ;{n tw%(maxf%,maxw%) template pointers for windows 890REM ;{n h%(maxf%)=File handles 0 = not open 900REM ;{n f%(maxf%)=Format handles 0 = not open, -ve = not linked 910REM ;{n s%(maxf%)=status (0=card displayed) 920REM ;{n (1=no cards in subset) 930REM ;{n (2=background action going on) 940REM ;{n s$(maxf%)=fast find string 950REM ;{n+ d$(maxf%,23)=23 subset descriptions 960REM ;{n+ f$(maxf%)=filter expressions 970REM ;{n+ fx$(maxf%)=filters after expansion for abbreviations 980REM ;{n+ e$(maxf%)=search expressions 990REM ;{n+ w$(maxf%,14)=wordprocessor output expressions 1000REM ;{n+ wo%(maxf%) 1010REM ;{n ex$(maxf%)=search expressions after expansion 1020REM ;{n fn$(maxf%)=file names 1030REM ;{n+ r%(maxf%)=report mode 1040REM ;{n a%(maxf%)=background action in this file, -ve=linked to action 1050REM ;{n e%(maxf%,2)=background activity status stuff: 1060REM ;{n fc%(maxf%)=fast find, number found last search 1070REM ;{n fl%(maxf%)=boolean flags: 1080REM ;{n+ t%(maxf%,3)=global variables for macros 1090REM ;{n+ l$(maxf%)=link expression for this file 1100REM ;{n+ lx$(maxf%)=expanded link expression. Also, link file name 1110REM ;{n+ lk$(maxf%)=link key 1120REM ;{n+ st%(maxf%,2)=file stats 1130REM ;{n 1140REM ;{n maxf% = max array index (files) 1150REM ;{n maxw% = max array index (windows) 1160REM ;{n 1170ft_form%=&DE7:ft_data%=&DE8:maxw%=7 1180DIM w%(maxf%,maxw%),h%(maxf%),f%(maxf%),s%(maxf%),s$(maxf%),fc%(maxf%) 1190DIM fl%(maxf%),a%(maxf%),d$(maxf%,23),f$(maxf%),fx$(maxf%),t%(maxf%,3) 1200DIM tw%(maxf%,maxw%),e$(maxf%),ex$(maxf%),e%(maxf%,2),r%(maxf%) 1210DIM fn$(maxf%),l$(maxf%),lx$(maxf%),lk$(maxf%),w$(maxf%,14),st%(maxf%,2) 1220DIM wo%(maxf%),o$(maxf%),o%(maxf%,6),r$(maxf%),sr$(maxf%),ll%(maxf%,5) 1230DIM lf%(maxf%,15),p%(maxf%,4),p$(maxf%,7),c$(maxf%,maxcol%,1) 1240DIM c%(maxf%,maxcol%) 1250f_filt%=1<<00:f_pane%=1<<01:f_macb%=1<<02:f_mace%=1<<03 1260f_fspc%=1<<04:f_fupp%=1<<05:f_sspc%=1<<06:f_supp%=1<<07 1270f_sadd%=1<<08:f_rspc%=1<<09:f_rupp%=1<<10:f_srup%=1<<11 1280f_stot%=1<<12:f_stit%=1<<13:f_sdas%=1<<14:f_wspc%=1<<15 1290f_wupp%=1<<16:f_wbnk%=1<<17:f_7bit%=1<<18:f_rejb%=1<<19 1300f_reja%=1<<20:f_rdsp%=1<<21:f_rtpn%=1<<22:f_rbpn%=1<<23 1310f_rpdt%=1<<24:f_rtpg%=1<<25:f_rtsu%=1<<26:f_rldu%=1<<27 1320f_rlsu%=1<<28 1330f_reps%=f_rldu%ORf_rlsu%ORf_rejb%ORf_reja%ORf_rdsp%ORf_rtpn%ORf_rbpn%ORf_rpdt%ORf_rtpg%ORf_rtsu% 1340f_save%=-1ANDNOT(f_pane%ORf_sadd%) 1350f_dflt%=f_fspc%ORf_fupp%ORf_sspc%ORf_supp%ORf_stot%ORf_stit%ORf_sdas%ORf_wspc% 1360ENDPROC 1370 1380DEFPROCsdvars 1390SYSswi%,sd64_%,3TOlinegap% 1400margin%=8:IFFNv_(1)=1:PROCerr(3) 1410IFsound%:SYSswi%,opt_%,10TOG%:ELSESYSswi%,opt_%,9TOG% 1420date%=FNnyear(FNnow)*10000+FNnmon(FNnow)*100+FNnday(FNnow) 1430ENDPROC 1440 1450DEFPROCcheckprot:LOCALT%:SYS"FlexiFile_Address"TOsd% 1460LOCALERROR 1470ONERRORLOCAL:process%=2:ENDPROC 1480SYSswi%,reset_%,taskhandle% 1490IFprocess%=3PROCstop(1,"OK. Please remove original &","replace backup if necessary",-1) 1500T%=FNnow:date$=FNstrdate(FNnday(T%),FNnmon(T%),FNnyear(T%),4) 1510PROCsdvars 1520process%=4:ENDPROC 1530 1540DEFPROCversion 1550LOCALT$:T$=version$:IFNOTFNprod:T$+=" *UNFINISHED*" 1560PROCseti(w_pinfo%,4,"v"+T$):$FNtia(tw_status%,11)="v"+T$ 1570ENDPROC 1580 1590DEFFNprod=MID$(version$,INSTR(version$,".")+1,1)="0" 1600DEFPROCdebug:IFINKEY-1ANDNOTFNprod:PROCquit(TRUE):ELSEENDPROC 1610DEFFNdebug=NOTFNprod ANDINKEY-1ANDINKEY-2 1620 1630DEFFNinitwimp:first%=FALSE:taskhandle%=FNtask:IFtaskhandle%<>0:=200 1640$q%="TASK":SYS"Wimp_Initialise",200,!q%,"MultiStore"TO!q%,taskhandle% 1650first%=TRUE:=!q% 1660 1670DEFPROCtidy 1680PROCnormpoint 1690VDU4,26:PRINTTAB(0,2);:*fx4 1700*fx225,1 1710*fx229 1720Z%=0:SYSswi%,killtask_% 1730ONERROR:REPORT:PRINT" ";ERL:PROCquit(TRUE) 1740PRINT;menuend%-menufree%" bytes menu space" 1750PRINT;endbuf%-curbuf%" bytes indirection buffer space" 1760PRINT;tbe%-tbs%" bytes template buffer" 1770ENDPROC 1780 1790DEFPROCbaricon:IFNOTfirst%:ENDPROC 1800!q%=-1:q%!4=0:q%!8=0:q%!12=102:q%!16=68 1810q%!20=%11000000000010:$(q%+24)="!"+LEFT$(appl$,9) 1820SYS"Wimp_CreateIcon",,q%TObaricon% 1830ENDPROC 1840 1850DEFPROCstrip(RETURN T$) 1860$sd%=T$:SYSswi%,strip_% 1870T$=$sd% 1880ENDPROC 1890 1900DEFPROCupper(RETURN T$) 1910$sd%=T$:SYSswi%,upper_% 1920T$=$sd%:ENDPROC 1930 1940DEFPROCerror(err%,err$,erl%,quit%) 1950IFFNdebug:VDU4,30:PRINTerr$" @ ";erl%;:PROCquit(TRUE) 1960PROCnormpoint:dragreason%=-1:@%=&90A:*fx229,1 1970LOCALi%,e%,t$,T$ 1980IFNOTFNprod:err$+=" ("+STR$ERL+")" 1990LOCALERROR 2000ONERRORLOCAL:PROCerror(ERR,REPORT$,ERL,TRUE) 2010!q%=err%:$(q%+4)=err$:SYS"Wimp_ReportError",q%,1,appl$ 2020IFquit%:PROCquit(FALSE) 2030ENDPROC 2040 2050DEFPROCreport:IFFNdebug:VDU4:REPORT:PRINT" @ ";ERL:PROCquit(TRUE) 2060ENDPROC 2070 2080DEFFNdir 2090LOCALT$:T$=FNArfVar(appl$+"$Dir") 2100IFT$="":T$="&.!"+LEFT$(appl$,9)+"." 2110IFRIGHT$(T$)<>".":T$+="." 2120=T$ 2130 2140DEFFNArfVar(A$):LOCALL%,V% 2150SYS"XOS_ReadVarVal",A$,workbuf%,254,0,3TO,,L%;V%:IFV%AND1:L%=0 2160workbuf%?L%=13:=$workbuf% 2170 2180DEFPROCumess1 2190ref%=q%!8:task%=q%!4:IFtask%=taskhandle%:ENDPROC 2200mess%=q%!16 2210CASEmess%OF 2220WHEN0:PROCCLOSE:PROCquit(FALSE) 2230WHEN1:PROCdatasaved 2240WHEN2:PROCsavedata 2250WHEN3:PROCdataload 2260WHEN4:ackpending%=FALSE 2270WHEN5:PROCdataopen 2280WHEN6: 2290WHEN7: 2300WHEN8:PROCprequit 2310WHEN9: 2320WHEN&502: 2330WHEN&400C0:PROCsubmenu(q%!20,q%!24,q%!28,q%+32) 2340WHEN&80300:PROCackrec 2350ENDCASE 2360ENDPROC 2370 2380DEFPROCdataopen 2390IFq%!40=ft_form%:PROCdataloadack:PROCerr(1) 2400IFq%!40<>ft_data%:ENDPROC 2410PROCdataloadack:mh%=-1:PROCcheckopen 2420IFprocess%=0:IFNOTFNdialogue:PROCmstore("2:"+FNzts(q%+44),"MultiStore") 2430ENDPROC 2440 2450DEFPROCcheckopen:IFFNv_(1)>0PROCerr(104) 2460ENDPROC 2470 2480DEFPROCdataload 2490IFcopying%>0PROCbuzz1:ENDPROC 2500del%=q%!12<>0 2510PROCreadpointer:PROCwtof(mh%) 2520CASE TRUE OF 2530WHEN q%!40=&1000:file$=FNzts(q%+44):PROCstop(38,RIGHT$(file$,29),rl$+" set picture path ?",-1) 2540WHEN q%!40=ft_data%ANDmh%=-2 2550PROCdataloadack 2560IFprocess%=0IFNOTFNdialogue:PROCcheckopen:PROCmstore("3:"+FNzts(q%+44),"MultiStore") 2570WHEN q%!40=ft_data%ANDmh%=w_transfer% 2580IFmi%=1ORmi%=2:PROCopensource(FNzts(q%+44)) 2590IFmi%=3ORmi%=4:PROCopentarget(FNzts(q%+44)) 2600WHEN q%!40=&FFD ANDmh%=-2 2610IFprocess%=0:IFNOTFNdialogue:PROCcheckconv(FNzts(q%+44)) 2620WHEN q%!40=ft_form% 2630PROCdataloadack:PROCwtof(mh%):IFwind%>1ORfile%<0:PROCerr(1) 2640PROCerr(203) 2650WHEN q%!40=&FFF ANDfile%>=0ANDwind%=6:PROCdataloadack:file$=FNzts(q%+44):PROCstop(14,fi$+FNfilename,rl$+"load notes ?",file%) 2660WHEN q%!40=&FFF ANDfile%>=0ANDwind%=7:PROCdataloadack:file$=FNzts(q%+44):PROCstop(19,fi$+FNfilename,rl$+"load macro ?",file%) 2670WHEN q%!40=&D7B:PROCdataloadack:file$=FNzts(q%+44):PROCchecksetup 2680ENDCASE 2690ENDPROC 2700 2710DEFPROCnoscrap 2720IFdel%:*remove <Wimp$Scrap> 2730ENDPROC 2740 2750DEFPROCdatasaved:IFFNdialogue:ENDPROC 2760PROCreadpointer:PROCwtof(mh%) 2770CASE TRUE OF 2780WHEN q%!40=&FFF ANDfile%>=0AND(wind%=6ORwind%=7ORwind%=0):PROCdatasaveack 2790ENDCASE 2800ENDPROC 2810 2820DEFPROCerr(E%) 2830LOCALT$,A$:IFfile%>=0A$=", "+fi$+FNfilename+" - ":ELSEA$=" - " 2840@%=&90A:*fx229,1 2850CASEE%OF 2860WHEN0:T$=REPORT$ 2870WHEN1:T$="To use a format, drag it onto a card" 2880WHEN2:T$="Must be version 1.8 WIMP or later" 2890WHEN3:T$="Sorry! Too many files already open" 2900WHEN4:T$="Sorry! You can only run one RAMManager task at a time" 2910WHEN5:T$="To save, drag the icon to a directory viewer or another task" 2920WHEN6:T$="Couldn't open file: "+REPORT$:IFREPORT$="Data lost":T$+=" (Ensure the disc is not write protected)" 2930WHEN7:T$="Couldn't open format: "+REPORT$ 2940WHEN8:T$="Filter expression"+A$+REPORT$ 2950WHEN9:T$="Search expression"+A$+REPORT$ 2960WHEN10:T$="Unbalanced quote marks ("")" 2970WHEN11:T$="Unbalanced brackets" 2980WHEN12:T$="No cards to search in this subset" 2990WHEN13:T$="The name should be 2-4 characters and start with a letter" 3000WHEN14:T$="Please specify the maximum value to store in the subset" 3010WHEN15:T$="Subset already exists" 3020WHEN16:T$="Field names must start with a letter" 3030WHEN17:T$="Copying/combining subsets"+A$+REPORT$ 3040WHEN18:T$="English query"+A$+REPORT$ 3050WHEN19:T$="Can't understand meaning" 3060WHEN20:T$="Macro line "+STR$(er%+1)+A$+REPORT$ 3070WHEN21:T$="Missing THEN or GO clause in IF statement" 3080WHEN22:T$="Invalid macro line number for GO" 3090WHEN23:T$="Illegal variable assignment" 3100WHEN24:T$="Field assignment expected" 3110WHEN25:T$="Field name not specified" 3120WHEN26:T$="Subset value assignment expected" 3130WHEN27:T$="Subset name/letter not specified" 3140WHEN28:T$="Invalid subset name/letter" 3150WHEN29:T$="Illegal notepad reference identifier" 3160WHEN30:T$="Abbreviated expression too complex to expand" 3170WHEN31:T$="Illegal pattern matching" 3180WHEN32:T$="Validating card"+A$+REPORT$+" (Filter/Subset disabled)" 3190WHEN33:T$="Illegal global variable number" 3200WHEN34:T$="Sort expression"+A$+REPORT$ 3210WHEN35:T$="Expression should not be blank" 3220WHEN36:T$="Fast find"+A$+"couldn't find matching card" 3230WHEN37:T$="Link expression"+A$+REPORT$ 3240WHEN38:T$="Link file not open" 3250WHEN39:T$="You can't link to an active file" 3260WHEN40:T$="You can't have a circular link setup" 3270WHEN41:T$="Printer already in use" 3280WHEN42:T$="Printer in use by file "+FNofilename(printer%) 3290WHEN43:T$="Printing"+A$+REPORT$+" (Report terminated)" 3300WHEN44:T$="Simple report definition"+A$+REPORT$ 3310WHEN45:T$="Report formula"+A$+REPORT$ 3320WHEN46:T$="Exporting report"+A$+REPORT$+" (export cancelled)" 3330WHEN47:T$="The two new passwords must be identical. Please re-enter" 3340WHEN48:T$="Not a suitable printer driver" 3350WHEN49:T$="You can't load that setup file there" 3360WHEN50:T$="Can't recognise format of setup file" 3370WHEN51:T$="You must specify the current password correctly" 3380WHEN54:T$="Plotting picture"+A$+REPORT$+" (release ALT to redraw)" 3390WHEN59:T$="Program not found" 3400WHEN60:T$=REPORT$+" - Can't load file creation software" 3410WHEN61:T$="Sorry! Not enough subsets available for a search" 3420WHEN62:T$=REPORT$+" - Can't load file system software" 3430WHEN100:T$=sy$+"You can't create a file/format while transferring cards" 3440WHEN103:T$=sy$+"No access to the printer driver while transferring cards" 3450WHEN104:T$=sy$+"You can't access files directly during a card transfer" 3460WHEN108:T$="This is a format, not a file" 3470WHEN109:T$=sy$+"You can't transfer cards into a format or undefined file" 3480WHEN110:T$=sy$+"You can't sort a file while you are creating it!" 3490WHEN200:T$="Please open both source and target files before proceeding (by dragging to the correct place on the transfer window)" 3500WHEN201:T$="You already have a source file open!" 3510WHEN202:T$="You already have a target file open!" 3520WHEN203:T$=sy$+"You can't use formats in card transfer mode" 3530WHEN204:T$="Field expression, field: "+FNfname(menufield%)+A$+REPORT$ 3540WHEN205:T$="Invalid field references" 3550WHEN206:T$="No transfer defined - please select objects to transfer" 3560WHEN207:T$="Couldn't transfer workspace: "+REPORT$ 3570WHEN208:T$=REPORT$+" - transfer failed" 3580WHEN209:T$="Couldn't transfer numeric subsets: "+REPORT$ 3590WHEN210:T$="Couldn't transfer card: "+REPORT$ 3600WHEN211:T$=sy$+"that's not a Transfer setup file" 3610WHEN212:T$="Please open both source and target files before loading setup" 3620WHEN213:T$=REPORT$+" - failed to load setup" 3630WHEN214:T$=sy$+"You can't copy the subsets without the cards" 3640WHEN215:T$="Please close source/target files before cancelling transfer" 3650ENDCASE 3660IFFNdebug:T$+=" ("+STR$ERL+") ["+STR$E%+"]" 3670ERROR99,T$ 3680 3690DEFPROCopenfile(f$):LOCALI%,T%:T%=opening% 3700w_open%=FNcrwind(tw_open%):PROCunselall(w_open%) 3710PROCseli(w_open%,1-7*(T%=1)) 3720IFT%=0PROCseli(w_open%,0):ELSEPROCshadei(w_open%,16) 3730FORI%=0TO8:PROCshadei(w_open%,I%):NEXT 3740file$=f$:PROCseti(w_open%,13,f$):PROCseti(w_open%,14,"") 3750$FNta(w_open%)="Open Source":IFT%=1$FNta(w_open%)="Open Target" 3760PROCdialogue(w_open%):ENDPROC 3770 3780DEFPROCopenfile1(f$,m%,d%,p$,r%) 3790LOCALI%,g%,h%,X%,Y%,T$ 3800LOCALERROR 3810ONERRORLOCAL:RESTOREERROR:PROCloaderr:ENDPROC 3820p$=FNsu(p$) 3830IFw%(opening%,0)>0PROCerr(3) 3840h%=opening%:T$=f$:m%=INT(99/(maxf%+1)+(99-(99/(maxf%+1)))*m%/7) 3850w%(h%,0)=FNcrwind(tw%(h%,0)):PROCmakepane(h%) 3860IFp$=""p$=FNpwcode(pass$) 3870pass$=FNpwcode(p$):IFclearpass%pass$="" 3880SYSswi%,password_%,p$ 3890g%=0:SYSswi%,open_%,T$,m%,d%,r%TOG% 3900g%=G%:IFg%OR?sd%<>13THENPROCwarnfile:g%=TRUE 3910h%(h%)=FNv_(2):PROCinitfile:PROCdefault 3920SYSswi%,selectkey_%,"?" 3930SYSswi%,sd45_%,"N" 3940T$="Source=":IFopening%=1:T$="Target=" 3950PROCsdfile(h%):$FNta(w%(h%,0))=T$+FNfilename:PROCfext:PROCreadws 3960IFopening%=0PROCinitpane 3970X%=h%*80+panew%+8:Y%=900-h%*40-paneh% 3980PROCopen(w%(h%,0),X%,Y%,X%+paneh%,Y%+paneh%,0,0,-1):PROCvalidrec 3990SYSswi%,sd57_%,"bit7"TOG% 4000PROCflg(f_7bit%,G%):fn$(h%)=f$ 4010IFopening%=1THEN 4020I%=4:PROCmakeflist(h%):SYSswi%,subset_%,0 4030SYSswi%,order_%TON% 4040ELSE 4050I%=2 4060ENDIF 4070PROCseti(w_transfer%,I%,FNfilename) 4080IFFNv_(1)<>4:PROCfront(w_transfer%,-1,-1) 4090IFg%PROCdialogue(w_mess%) 4100ENDPROC 4110 4120DEFPROCwarnfile 4130LOCALT%,t%,I%,T$:w_mess%=FNcrwind(tw_mess%) 4140RESTORE+1:FORI%=0TO7:READT$ 4150IFg%AND(2^I%):PROCseti(w_mess%,T%,T$):T%+=1 4160NEXT:IF$sd%>""THEN 4170PROCseti(w_mess%,T%,"Password violations have occured as follows:"):T%+=1 4180t%=sd%:REPEAT 4190IFt%<sd%+192:IF$t%>"":PROCseti(w_mess%,T%," Using "+$t%):T%+=1 4200t%+=64:UNTILt%=sd%+192 4210ENDIF 4220WHILET%<6:PROCseti(w_mess%,T%,""):T%+=1:ENDWHILE:ENDPROC 4230DATA"** This file MAY be CORRUPTED due to illegal closure **" 4240DATA" ** This file has been accessed by older software **" 4250DATA,,,, 4260 4270DEFPROCinitfile 4280f%(h%)=0:s%(h%)=0:s$(h%)="":fc%(h%)=-1 4290a%(h%)=0:f$(h%)="":fx$(h%)="":e$(h%)="":ex$(h%)="":r%(h%)=1 4300o$(h%)="":o%(h%,0)=3:r$(h%)="":FORI%=0TO3:t%(h%,I%)=0:NEXT 4310l$(h%)="":lk$(h%)="":lx$(h%)="":sr$(h%)="" 4320fn$(h%)="":p%(h%,0)=0:p$(h%,0)="" 4330FORI%=0TO23:d$(h%,I%)="":NEXT:FORI%=0TO18:PROCnote(h%,I%,""):NEXT 4340FORI%=0TO29:PROCmacln(h%,I%,""):NEXT:wo%(h%)=0 4350FORI%=0TO15:lf%(h%,I%)=0:NEXT:FORI%=0TO14:w$(h%,I%)="":NEXT 4360ll%(h%,0)=30:ll%(h%,1)=4:ll%(h%,2)=4:ll%(h%,3)=9:ll%(h%,4)=2:ll%(h%,5)=1 4370fl%(h%)=f_dflt%:IFtools%:fl%(h%)=fl%(h%)ORf_pane% 4380ENDPROC 4390 4400DEFPROCloaderr:LOCALI% 4410PROCnormpoint:IFh%>=0THEN 4420IFg%:PROCdelw(w_mess%) 4430IFw%(h%,0)>0PROCdelw(w%(h%,0)) 4440IFw%(h%,1)>0PROCdelw(w%(h%,1)) 4450IFh%(h%)>0:PROCclosefile(h%) 4460IFERR=&80301THEN 4470w_open%=FNcrwind(tw_open%):PROCunselall(w_open%):PROCseli(w_open%,m%+1) 4480IFd%PROCseli(w_open%,0):IFopening%<>0:PROCshadei(w_open%,16) 4490FORI%=0TO8:PROCshadei(w_open%,I%):NEXT 4500file$=f$:PROCseti(w_open%,13,f$):PROCseti(w_open%,14,"") 4510$FNta(w_open%)="Open Source":IFopening%=1$FNta(w_open%)="Open Target" 4520PROCdialogue(w_open%):file%=-1:ENDPROC 4530ENDIF 4540ENDIF 4550file%=-1:PROCerr(6):ENDPROC 4560 4570DEFPROCclosefile(h%):LOCALI% 4580PROCsdfile(h%):PROCready:PROCwritews 4590PROCcloseform:PROCdelfilews(h%) 4600h%(h%)=0:s%(h%)=0:f%(h%)=0:a%(h%)=0:w%(h%,0)=-1E9 4610closeok%=FALSE:file%=-1:SYSswi%,close_%TOS% 4620PROCreadtran:PROCtransfer:ENDPROC 4630 4640DEFPROCalign(h%,I%):IFtx1%-tx0%>108:ENDPROC 4650DEFPROCalign1(h%,I%) 4660tx0%=h%*80+I%*40-40+panew%+8:tx1%=tx0%+440 4670ty1%=900-h%*40-I%*40+40:ty0%=ty1%-320 4680ENDPROC 4690 4700DEFPROCmakepane(h%) 4710LOCALP%:P%=FNcrwind(tw%(h%,1)):w%(h%,1)=P% 4720PROCgetw(P%):paneh%=y1%-y0%:panew%=x1%-x0%:PROCwext(P%,panew%,paneh%) 4730IFh%=target%:PROCdelw(w%(h%,1)) 4740ENDPROC 4750 4760DEFPROCmakesubs(h%) 4770LOCALP%,T$,I%,J%,K%,T% 4780K%=w%(h%,2)>0:IFK%PROCgetw(w%(h%,2))ELSEPROCreadblock(tw%(h%,2)) 4790tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:PROCalign(h%,2) 4800PROCdelfilew(h%,2):P%=FNcrwind(tw%(h%,2)):w%(h%,2)=P%:PROCsdfile(h%) 4810$FNta(w%(h%,2))="Subsets of "+FNfilename 4820T$=FNsubstr:FORI%=0TO23 4830IFMID$(T$,I%+1,1)<>".":PROCloseicon(P%,I%+5):PROCloseicon(P%,I%+29) 4840NEXT 4850WHILET$>""ANDRIGHT$(T$)<>".":T$=LEFT$(T$):ENDWHILE:T$=LEFT$(T$,24) 4860C%=((LENT$-1)DIV6+1)*56+62:IFK%:C%=ty1%-ty0% 4870T%=(3-(LENT$-1)DIV6)*56:J%=0:FORI%=0TO9:T$=FNsubname(I%) 4880PROCseti(P%,I%+53,T$):IFT$=""THEN 4890PROCloseicon(P%,I%+53) 4900ELSE 4910PROCgeti(P%,I%+53):PROCdelicon(P%,I%+53):J%=I%+1 4920q%!4=!q%:q%!12+=T%:q%!20+=T%:SYS"Wimp_CreateIcon",,q%+4 4930ENDIF 4940NEXT:PROCgeti(P%,4):PROCdelicon(P%,4) 4950q%!4=!q%:q%!12+=T%:q%!20+=T%:SYS"Wimp_CreateIcon",,q%+4 4960T%+=((10-J%)DIV5)*64:PROCgetw(P%):PROCwext(P%,ex1%,-ey0%-T%) 4970PROCshowsub1:PROCopen(w%(h%,2),tx0%,ty1%-C%,tx1%+x1%-x0%,ty1%,0,0,-1) 4980ENDPROC 4990 5000DEFPROCmakeflist(h%):LOCALX%,Y%,T% 5010LOCALP%:P%=FNmakewind(h%,4):T%=FNta(P%):$T%="Fields="+FNfilename 5020T%=LEN$T%+4:PROCformstat:SYSswi%,sd64_%,1TOG% 5030IFG%<T%G%=T% 5040X%=G%:IFh%=target%:fwid%=X%*16+margin%+16 5050IFh%=target%X%=255 5060Y%=FNv_(7):PROCwext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2) 5070ENDPROC 5080 5090DEFPROCmakeilist(h%):LOCALX%,Y%,T% 5100LOCALP%:P%=FNmakewind(h%,5):T%=FNta(P%):$T%="Indices="+FNfilename 5110T%=LEN$T%+4:SYSswi%,sd64_%,2TOG% 5120IFG%<T%G%=T% 5130X%=G%:Y%=FNnindices 5140PROCwext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2):ENDPROC 5150 5160DEFPROCmakenotes(h%) 5170LOCALP%:P%=FNmakewind(h%,6):$FNta(P%)="Notepad="+FNfilename 5180ENDPROC 5190 5200DEFPROCmakemacro(h%) 5210LOCALP%:P%=FNmakewind(h%,7):$FNta(P%)="Macro="+FNfilename 5220ENDPROC 5230 5240DEFFNmakewind(h%,T%):LOCALP%,I%,K% 5250K%=w%(h%,T%)>0:IFK%PROCgetw(w%(h%,T%))ELSEPROCreadblock(tw%(h%,T%)) 5260tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:PROCalign(h%,T%) 5270PROCdelfilew(h%,T%):P%=FNcrwind(tw%(h%,T%)):w%(h%,T%)=P%:PROCsdfile(h%) 5280PROCopen(P%,tx0%,ty0%,tx1%,ty1%,0,0,-1):=P% 5290 5300DEFFNcrwind(T%):SYS"Wimp_CreateWindow",,T%TOT%:=T% 5310 5320DEFPROCinitpane 5330PROCgraph:PROCseti(w%(file%,1),7,s$(file%)) 5340PROCshowsub:PROCshowindex:PROCshowfilter:PROCshowfound:PROCshowmac 5350ENDPROC 5360 5370DEFPROCgraph:IFfile%<>source%:ENDPROC 5380LOCALP%,T%:T%=file%:P%=w%(T%,1) 5390PROCgeti(P%,12):SYS"Wimp_DeleteIcon",,q%:q%!4=!q% 5400q%!16=6+(326-6)*FNv_(17)/(FNv_(16)-(FNv_(16)=0)) 5410SYS"Wimp_CreateIcon",,q%+4 5420SYS"Wimp_ForceRedraw",P%,6,-216,326,-196 5430PROCshownum:ENDPROC 5440 5450DEFPROCshownum 5460LOCALP%,T%,T$:T%=file%:PROCsdfile(T%):P%=w%(T%,1):IFP%<0ENDPROC 5470N%=FNv_(15):R%=FNv_(17) 5480PROCgeti(P%,13):SYS"Wimp_DeleteIcon",,q% 5490IFFNbadrec(N%)THEN 5500T$="??????????":q%!16=10 5510ELSE 5520T$="C"+RIGHT$("0000000000"+STR$N%,LOG(R%-(R%<1))+1) 5530IFN%=0:T$="Default" 5540q%!16=6+(326-6)*N%/(FNv_(16)-(FNv_(16)=0)) 5550ENDIF 5560q%!4=!q%:q%!8=q%!16-4:q%!12=-216:q%!20=-196:SYS"Wimp_CreateIcon",,q%+4 5570PROCseti(P%,14,T$):PROCiconupd(P%,12) 5580ENDPROC 5590 5600DEFPROCshowsub:LOCALP%:P%=w%(file%,1):IFP%<0ENDPROC 5610PROCseti(P%,17,FNsubdesc):PROCshowsub1:ENDPROC 5620 5630DEFPROCshowsub1:LOCALP% 5640P%=w%(file%,2):IFP%>0THEN 5650PROCsubdisp1:PROCunselall(P%):IFFNv_(11)=0THEN 5660PROCseli(P%,1) 5670ELSE 5680PROCseli(P%,(FNv_(11)AND31)+28) 5690IFsubset%>31:PROCseli(P%,(FNv_(11)AND31)+4) 5700ENDIF 5710ENDIF 5720ENDPROC 5730 5740DEFPROCshowindex:LOCALP%,T%:P%=w%(file%,1):IFP%<0ENDPROC 5750SYSswi%,istat_%,-1TOG%,T% 5760IFT%<=0$sd%=" * No Index *" 5770PROCseti(P%,16,$sd%):ENDPROC 5780 5790DEFPROCshowfilter 5800LOCALP%,T$:P%=w%(file%,1):IFP%<0ENDPROC 5810IFFNflg(f_filt%)T$=FNtrunc(f$(file%),19):ELSET$=" * No Filter *" 5820PROCseti(P%,21,T$) 5830ENDPROC 5840 5850DEFPROCshowmac 5860LOCALP%,T$:P%=w%(file%,1):IFP%<0ENDPROC 5870IFFNmacmode:PROCseli(P%,18):ELSEPROCunseli(P%,18) 5880ENDPROC 5890 5900DEFFNtrunc(T$,T%):IFLENT$<=T%:=T$:ELSE=LEFT$(T$,T%-3)+"..." 5910 5920DEFPROCshowfound:LOCALP%:P%=w%(file%,1):IFP%<0ENDPROC 5930PROCseti(P%,23,""):PROCseti(P%,19,"") 5940ENDPROC 5950 5960DEFPROCdelfilews(h%):LOCALI%:IFw%(h%,0)>0PROCdelw(w%(h%,0)) 5970FORI%=1TOmaxw%:PROCdelfilew(h%,I%):NEXT:ENDPROC 5980 5990DEFPROCdelfilew(h%,I%) 6000IFw%(h%,I%)>0:PROCclosew(w%(h%,I%)):IFw%(h%,I%)>0PROCdelw(w%(h%,I%)) 6010ENDPROC 6020 6030DEFPROCumess2 6040CASEq%!16OF 6050WHEN6:IFq%!8=loadref%:PROCdatasaveack:ENDPROC 6060ENDCASE 6070ENDPROC 6080 6090DEFPROCbackgrnd:LOCALT% 6100IFackpending%:ackpending%=FALSE 6110IFsbfile%>=0:PROCsubdisp 6120L%=lastact%:REPEAT 6130L%=(L%+1)MOD(maxf%+1) 6140UNTILL%=lastact%OR(a%(L%)>0ANDL%<>stopfile%) 6150IFa%(L%)=0ORL%=stopfile%ORdialogue%>0:ENDPROC 6160lastact%=L%:PROCsdfile(L%):T%=TIME:CASEa%(L%)OF 6170WHEN1:PROCcopynext 6180ENDCASE 6190T%=(TIME-T%+4)DIV5:IFT%<0T%=0:ELSEIFT%>50T%=50 6200SYS"OS_ReadMonotonicTime"TOdelay%:delay%+=T% 6210ENDPROC 6220 6230DEFPROCtemplate1(T$,q%):T$=FNlower(T$):LOCAL I%,T%,L% 6240I%=temp%+16:WHILE!I%>0ANDFNlower($(I%+12))<>T$:I%+=24:ENDWHILE 6250IF!I%<=0:ERROR99,"Template '"+T$+"' not found" 6260T%=temp%+!I%:L%=I%!4:FORI%=0TOL%STEP4:q%!I%=T%!I%:NEXT:T%=q%+88+q%!84*32 6270IF(q%!56)AND(1<<8)THEN 6280q%!72=FNworkspace(q%!80):$(q%!72)=$T%:T%+=LEN$T%+1 6290IFq%!76>0:q%!76=FNworkspace(LEN$T%+1):$(q%!76)=$T%:T%+=LEN$T%+1 6300ENDIF 6310IFq%!84>0THEN 6320FORI%=q%+88TOq%+84+q%!84*32STEP32 6330IF(I%!16)AND(1<<8)THEN 6340I%!20=FNworkspace(I%!28):$(I%!20)=$T%:T%+=LEN$T%+1 6350IFI%!24>0:I%!24=FNworkspace(LEN$T%+1):$(I%!24)=$T%:T%+=LEN$T%+1 6360ENDIF 6370NEXT 6380ENDIF 6390q%!64=sprites% 6400ENDPROC 6410 6420DEFPROCopentemplate(A$):temp%=HIMEM-30000 6430OSCLI"Load "+A$+" "+STR$~temp%:ENDPROC 6440 6450DEFPROCtemplate(T$) 6460PROCtemplate1(T$,q%) 6470ENDPROC 6480 6490DEFFNtemplate(T$) 6500PROCtemplate1(T$,tbs%) 6510T%=tbs%:tbs%+=88+tbs%!84*32 6520IFtbs%>tbe%:ERROR99,"Template buffer full" 6530=T% 6540 6550DEFPROCdefws 6560LOCALI% 6570bufsz%=&3000 6580DIM buffer% bufsz%:curbuf%=buffer%:endbuf%=buffer%+bufsz% 6590PROCopentemplate(FNdir+"MSFrm5") 6600PROCtemplate("stopbox"):SYS"Wimp_CreateWindow",,q%TOw_stop% 6610PROCtemplate("save") 6620q%!64=1:SYS"Wimp_CreateWindow",,q%TOw_save% 6630PROCtemplate("ProgInfo"):SYS"Wimp_CreateWindow",,q%TOw_pinfo% 6640PROCtemplate("ProgInfo2"):SYS"Wimp_CreateWindow",,q%TOw_pinfo2% 6650PROCtemplate("shadow"):SYS"Wimp_CreateWindow",,q%TOw_shadow% 6660bufsz%=&4500 6670DIM template% bufsz%:tbs%=template%:tbe%=tbs%+bufsz% 6680FORI%=0TOmaxf% 6690tw%(I%,0)=FNtemplate("file") 6700tw%(I%,1)=FNtemplate("filepane") 6710tw%(I%,2)=FNtemplate("subsets") 6720tw%(I%,3)=FNtemplate("FieldList") 6730tw%(I%,4)=FNtemplate("FieldList") 6740tw%(I%,5)=FNtemplate("FieldList") 6750tw%(I%,6)=FNtemplate("Notepad") 6760tw%(I%,7)=FNtemplate("Macro") 6770NEXT 6780PROCopentemplate(FNdir+"MSFrm6") 6790tw_expr%=FNtemplate("expression"):w_expr%=-1E9 6800tw_nums%=FNtemplate("numeric"):w_nums%=-1E9 6810tw_open%=FNtemplate("open"):w_open%=-1E9 6820tw_status%=FNtemplate("Status"):w_status%=-1E9 6830tw_mess%=FNtemplate("message"):w_mess%=-1E9 6840tw_transfer%=FNtemplate("transfer"):w_transfer%=-1E9 6850tw_transexp%=FNtemplate("transexp"):w_transexp%=-1E9 6860ENDPROC 6870 6880DEFPROCloadsprites 6890ssize%=16*1024 6900DIMsprites% ssize% 6910!sprites%=ssize%:SYS"OS_SpriteOp",&109,sprites% 6920SYS"OS_SpriteOp",&10A,sprites%,FNdir+"MSSpr" 6930ENDPROC 6940 6950DEFPROCdefmenus 6960LOCALt$ 6970DIM mlist% 32,function% 51 6980bufsz%=&900 6990DIM menufree% bufsz%:menuptr%=menufree%:menuend%=menufree%+bufsz% 7000menustart%=menufree%:RESTORE+2 7010READt$:m_npad%=FNcrmenu(t$) 7020DATA"#Notepad,Clear,Export>w_save%,Update" 7030READt$:m_main%=FNcrmenu(t$) 7040DATA"#MultiStore,Info>w_pinfo%,Transfer,Fast Sort,Create,Status,Printer,Quit" 7050READt$:m_macro1%=FNcrmenu(t$) 7060DATA"#Macro,Use#,Clear,Export>w_save%" 7070READt$:m_wind%=FNcrmenu(t$) 7080DATA"#Window,Subset,Field,Index,Notepad,Macro#,Tidy Up" 7090READt$:m_card%=FNcrmenu(t$) 7100DATA"#Card,Tools>w_pinfo%,Macro,Default,Window>m_wind%" 7110READt$:m_rtype%=FNcrmenu(t$) 7120DATA"#Type,Cards,Sheet,Formula,Labels,Wordpro,Paged" 7130READt$:m_rset1%=FNcrmenu(t$) 7140DATA"#Setup,Edit,Clear,Save}w_save%" 7150READt$:m_report%=FNcrmenu(t$) 7160DATA"#Report,Type>m_rtype%,Setup>m_rset1%,Print,Export}w_save%" 7170READt$:m_status%=FNcrmenu(t$) 7180DATA"#Statusmenu..,Align Windows,Read Workspace,Write Workspace,Update Media,Extended Charset" 7190READt$:m_index%=FNcrmenu(t$) 7200DATA"#Index,Ascending,Descending#,No Index" 7210READt$:m_transfer%=FNcrmenu(t$) 7220DATA"#Transfer,Swap Files,Open Target,Clear Setup,Default,Save Setup>w_save%" 7230ENDPROC 7240 7250DEFPROCfront(h%,X%,Y%) 7260PROCgetw(h%) 7270IFX%>=0x1%+=X%-x0%:x0%=X% 7280IFY%>=0y1%+=Y%-y0%:y0%=Y% 7290PROCopen(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1) 7300ENDPROC 7310 7320DEFPROCtop(h%) 7330PROCgetw(h%):PROCopen(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1):ENDPROC 7340 7350DEFPROCopen(oh%,ox0%,oy0%,ox1%,oy1%,oscx%,oscy%,obh%) 7360LOCALO%,f%:f%=file% 7370!q%=oh%:SYS"Wimp_GetWindowState",,q% 7380PROCwtof(oh%):IFfile%>=0THEN 7390CASEwind%OF 7400WHEN0:IFfile%<>target%PROCopenpane:ELSEPROCwimpopen 7410OTHERWISE:PROCwimpopen 7420ENDCASE 7430ELSE 7440CASEoh%OF 7450OTHERWISE:PROCwimpopen 7460ENDCASE 7470ENDIF 7480IFoh%=dialogue%ANDshadows%:PROCgetw(oh%):PROCopen(w_shadow%,x0%+ss%,y0%-ss%,x1%+ss%,y1%-ss%,0,0,dialogue%) 7490open%=O%:IFf%>=0:PROCsdfile(f%) 7500ENDPROC 7510 7520DEFPROCwimpopen 7530!q%=oh%:q%!4=ox0%:q%!8=oy0%:q%!12=ox1%:q%!16=oy1% 7540q%!20=oscx%:q%!24=oscy%:q%!28=obh%:SYS"Wimp_OpenWindow",,q% 7550ENDPROC 7560 7570DEFPROCopenpane 7580IFNOTFNflg(f_pane%):PROCwimpopen:ENDPROC 7590LOCALP%,f%:P%=w%(file%,1) 7600f%=oy1%-paneh%:IFf%<oy0%f%=oy0% 7610PROCgetw(P%) 7620IFbhandle%=obh%ORobh%=w%(file%,0)THEN 7630obh%=P% 7640IFNOTopen%PROCopen(P%,ox0%-panew%-4,f%,ox0%-4,oy1%,0,0,obh%) 7650ENDIF 7660PROCgetw(P%):f%=oy1%-paneh%:IFf%<oy0%f%=oy0% 7670PROCwimpopen 7680PROCgetw(w%(file%,0)):IFobh%=-2:obh%=bhandle% 7690f%=oy1%-paneh%:IFf%<oy0%f%=oy0% 7700PROCopen(P%,x0%-panew%-4,f%,x0%-4,y1%,0,0,obh%) 7710ENDPROC 7720 7730DEFPROCclosew(!q%) 7740LOCALI%,f%:f%=file% 7750PROCwtof(!q%) 7760IFfile%>=0THEN 7770CASEwind%OF 7780WHEN0:IFFNshowbranch:ENDPROC:ELSEIFNOTcloseok%:PROCcloseok:ENDPROC 7790WHEN3:IFfile%=edfile%:IFedrec%>=0:PROCendedit:!q%=w%(file%,3) 7800ENDCASE 7810ENDIF 7820IF!q%=dialogue%:PROCtidydial 7830SYS"Wimp_CloseWindow",,q% 7840PROCnodial:PROCwtof(!q%):IFfile%>=0THEN 7850CASEwind%OF 7860WHEN0:PROCclosefile(file%) 7870WHEN2,3,4,5,6,7:PROCdelw(w%(file%,wind%)) 7880ENDCASE 7890ELSE 7900CASE!q%OF 7910WHENw_stop%:stopfile%=-1 7920WHENw_expr%:PROCdelw(w_expr%) 7930WHENw_open%:PROCdelw(w_open%) 7940WHENw_nums%:PROCdelw(w_nums%) 7950WHENw_status%:PROCdelw(w_status%) 7960WHENw_mess%:PROCdelw(w_mess%) 7970WHENw_transfer%:PROCdelw(w_transfer%) 7980WHENw_transexp%:PROCdelw(w_transexp%) 7990ENDCASE 8000ENDIF 8010ENDPROC 8020 8030DEFPROCtidydial:PROCrestorect 8040dialreason%=-1:dialogue%=-1:PROCclosew(w_shadow%):exi0%=-1:exi1%=-1 8050dialfile%=-1:ENDPROC 8060 8070DEFPROCrestorect 8080LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 8090SYS "Wimp_GetCaretPosition",,workbuf% 8100IF!workbuf%=dialogue%SYS "Wimp_SetCaretPosition",!dialct%,dialct%!4,dialct%!8,dialct%!12,dialct%!16,dialct%!20 8110ENDPROC 8120 8130DEFPROCdelw(RETURN T%):!q%=T%:SYS"Wimp_DeleteWindow",,q%:T%=-1E9:ENDPROC 8140 8150DEFFNia(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!28 8160DEFFNva(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!32 8170DEFFNil(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!36 8180 8190DEFFNtia(T%,i%):LOCALq%:q%=T%+32*i%+88:PROCchkii:=q%!20 8200 8210DEFPROCchkii:IF(q%!24AND&100)=0ERROR1,"Icon not indirected" 8220ENDPROC 8230 8240DEFPROCgeti(h%,i%):!q%=h%:q%!4=i%:SYS"Wimp_GetIconState",,q%:ENDPROC 8250 8260DEFFNta(h%):!q%=h%:SYS"Wimp_GetWindowInfo",,q% 8270IF(q%!60AND&100)=0ERROR1,"Title not indirected" 8280=q%!76 8290 8300DEFPROCstop(r%,T$,U$,T%) 8310dialreason%=r%:stopfile%=T% 8320IFINKEY-3ORNOTstopboxes%:mi%=3:PROCmstop:ENDPROC 8330PROCseti(w_stop%,0,T$):PROCseti(w_stop%,1,U$) 8340PROCunselall(w_stop%):PROCdialogue(w_stop%) 8350dialreason%=r%:stopfile%=T% 8360ENDPROC 8370 8380DEFPROCdialogue(h%) 8390LOCALX%,Y%:PROCnodial 8400SYS "Wimp_GetCaretPosition",,dialct% 8410dialfile%=file%:PROCnomenu:PROCreadpointer:X%=mx%-200:Y%=my%-85 8420IFX%<0X%=0 8430IFY%<96Y%=96 8440dialogue%=h% 8450PROCfront(h%,X%,Y%) 8460PROCsetct(h%,-1,-1) 8470RESTORE17250:REPEAT 8480PROCreadh(h%):IFh%=dialogue%:READX%:PROCsetct(h%,X%,LEN$FNia(h%,X%)) 8490IFh%<>-1:REPEAT:READX%:UNTILX%<-1:h%=0 8500UNTILh%=dialogue%ORh%<0 8510ENDPROC 8520 8530DEFPROCreadpointer:LOCALq%:q%=workbuf% 8540SYS"Wimp_GetPointerInfo",,q% 8550mx%=!q%:my%=q%!4:mb%=q%!8:mh%=q%!12:mi%=q%!16 8560ENDPROC 8570 8580DEFFNdialogue:LOCALfile% 8590IFdialogue%>=0ANDmh%<>dialogue%ANDmh%<>w_shadow%PROCnodial 8600=FALSE 8610 8620DEFPROCmouse(mx%,my%,mb%,mh%,mi%,mo%) 8630IFdragreason%>=0ORmb%>255:ENDPROC 8640PROCwtof(mh%):IFfile%>=0ANDwind%=6AND(mb%=1ORmb%=4)ANDmi%<19:ENDPROC 8650IFmb%<16:IFFNdialogue:ENDPROC 8660w_info%=w_pinfo%:IFmb%=7:mb%=2:w_info%=w_pinfo2% 8670IFcopying%>0:IFmh%<>dialogue%AND(mh%<>w_transfer%ORmi%<>16)PROCbuzz1:ENDPROC 8680CASEmb%OF 8690WHEN2:PROCmenu 8700WHEN1,4:PROCselect 8710WHEN16,64:PROCstartdrag 8720ENDCASE 8730ENDPROC 8740 8750DEFPROCseti(h%,i%,T$):T$=LEFT$(T$,FNil(h%,i%)):$FNia(h%,i%)=T$ 8760PROCiconupd(h%,i%):PROCgetct:IF!q%=h%ANDq%!4=i%:PROCsetct(h%,i%,LENT$) 8770ENDPROC 8780 8790DEFPROCiset(h%,i%,B%,E%):LOCALq%:q%=workbuf% 8800!q%=h%:q%!4=i%:q%!12=B%:q%!8=E%:SYS"Wimp_SetIconState",,q%:ENDPROC 8810 8820DEFPROCiconupd(h%,i%):PROCiset(h%,i%,0,0):ENDPROC 8830 8840DEFPROCforce(h%) 8850CASEh%OF 8860OTHERWISESYS"Wimp_ForceRedraw",h%,-1E9,-1E9,1E9,1E9 8870ENDCASE 8880ENDPROC 8890 8900DEFPROCreadblock(p%) 8910x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12:REM physical area 8920scx%=p%!16:scy%=p%!20:bhandle%=p%!24:REM scroll offsets, stack depth 8930bx%=x0%-scx%:by%=y1%-scy%:REM calculate physical co-ords of logical area 8940ex0%=p%!40:ey0%=p%!44:ex1%=p%!48:ey1%=p%!52:REM logical area 8950gx0%=p%!24:gy0%=p%!28:gx1%=p%!32:gy1%=p%!36:REM graphics window 8960open%=(p%!28AND&10000)<>0:REM window open flag 8970ENDPROC 8980 8990DEFPROCgetw(h%) 9000!q%=h%:SYS"Wimp_GetWindowInfo",,q% 9010PROCreadblock(q%+4) 9020ENDPROC 9030 9040DEFPROCselect 9050IFFNnumi(mh%,mi%,mb%) 9060IFfile%>=0THEN 9070CASEwind%OF 9080WHEN0:IFfile%=target%THEN 9090PROCready 9100ENDIF 9110WHEN1:PROCmpane 9120WHEN2:PROCmsubs 9130WHEN4:PROCmflist 9140WHEN5:PROCmilist 9150ENDCASE 9160ELSE 9170IFmh%=dialogue%:IFdialfile%>=0:PROCsdfile(dialfile%) 9180CASEmh%OF 9190WHEN-2:IFmb%=1ANDINKEY-1ANDINKEY-2:PROCoscli(""):ELSEPROCstatus 9200WHENw_open%:PROCmopen 9210WHENw_stop%:PROCmstop 9220WHENw_save%:PROCmsave 9230WHENw_expr%:PROCmexpr 9240WHENw_status%:PROCmstatus 9250WHENw_mess%:IFmi%=6:PROCclosew(w_mess%) 9260WHENw_transfer%:PROCmtransfer 9270WHENw_transexp%:PROCmtransexp 9280ENDCASE 9290ENDIF 9300ENDPROC 9310 9320DEFPROCmilist:LOCALY%:Y%=my%:PROCyconv(Y%,FNnindices,mh%) 9330IFY%>0:PROCselindex(Y%,0) 9340ENDPROC 9350 9360DEFPROCmflist:LOCALY%:Y%=my%:PROCyconv(Y%,FNv_(7),mh%) 9370menufield%=Y%:expfield%=Y%:IFmb%<>1PROCfindfield:ELSEPROCfieldexp 9380ENDPROC 9390 9400DEFPROCmpane 9410CASEmi%OF 9420WHEN0:PROCbof 9430WHEN1:PROCback 9440WHEN2:PROCpause 9450WHEN3:PROCfwd 9460WHEN4:PROCeof 9470WHEN5:PROCffind 9480WHEN6:PROCnextmatch 9490WHEN12:PROCgauge 9500WHEN14:PROCcardnum 9510WHEN18:IFmb%=4PROCemacro:ELSEIFs%(file%)=0:PROCmacro 9520WHEN17:IFmb%=1:PROCselsub(0):ELSEPROCsubs 9530WHEN16:IFmb%=1:PROCselindex(0,0):ELSEPROCindex 9540WHEN21:PROCfilter 9550ENDCASE 9560ENDPROC 9570 9580DEFPROCfilter 9590IFNOTFNdeadfile(%11111111111111110)THEN 9600IFmb%=1:PROCnofilt:ELSEPROCexpr(0) 9610ENDIF 9620ENDPROC 9630 9640DEFPROCmsubs 9650IFFNdeadfile(%11111111111111110)ENDPROC 9660LOCALT%:T%=FNitos:IFT%>=0:PROCselsub(T%):ENDPROC 9670ENDPROC 9680 9690DEFPROCmstop 9700IFmi%<3ORmi%>4ENDPROC 9710LOCALT%,U%:U%=stopfile%:T%=dialreason%:dialreason%=-1 9720IFmi%=3THEN 9730PROCclosew(w_stop%):IFU%>=0:PROCsdfile(U%) 9740CASET%OF 9750WHEN2:closeok%=TRUE:PROCclosew(w%(file%,0)) 9760WHEN6:PROCCLOSE:PROCquit(FALSE) 9770WHEN14:PROCloadnotes 9780WHEN17:PROCclearnpad 9790WHEN18:PROCclearmacro 9800WHEN19:PROCloadmacro 9810WHEN20:stopboxes%=FALSE 9820WHEN22:PROCupdcards 9830WHEN26:PROCasccard 9840WHEN27:SYSswi%,setpass_%,"" 9850WHEN28:PROCloadsetup 9860WHEN29:p$(file%,0)="":PROCmakerep(file%) 9870WHEN30:ll%(file%,0)=0:PROCmakerep(file%) 9880WHEN31:wo%(file%)=-1:PROCmakerep(file%) 9890WHEN32:SYSswi%,sd21_%,tx0%,ty0%,menufield%,sd$ 9900PROCforcecard 9910WHEN33:PROCr_clear:PROCforcerep 9920WHEN34:PROCdelcol(menucol%) 9930WHEN35:PROCinscol(menucol%) 9940WHEN36:OSCLI"*settype "+file$+" "+STR$~menufield% 9950WHEN38:PROCpicpath 9960WHEN200:PROCendact 9970WHEN201:PROCloadsetup 9980WHEN202:PROCclear 9990WHEN203:PROCdefault 10000ENDCASE 10010ELSE 10020IFT%=1:PROCCLOSE:PROCquit(FALSE) 10030ENDIF 10040PROCclosew(w_stop%):ENDPROC 10050 10060DEFPROCmsave 10070IFmi%<>0ENDPROC 10080LOCALT$:T$=$FNia(w_save%,2):IFT$=FNleaf(T$):PROCerr(5) 10090savetype%=savet%:task%=-1:file$=T$:PROCsavedata1 10100ENDPROC 10110 10120DEFPROCmnums:IFmi%<>4ANDmi%<>5:ENDPROC 10130LOCALT%,B%,T$:IFmi%=5THEN 10140B%=VAL$FNia(w_nums%,3):IFB%=0:PROCerr(14) 10150T%=0:WHILE2^T%<=B%:T%+=1:ENDWHILE:B%=2^T%-1 10160T$=FNup(FNs($FNia(w_nums%,2))):IFLENT$<2ORASCT$>90ORASCT$<65:PROCerr(13) 10170CASEdialreason%OF 10180WHEN0 10190T%=TRUE:LOCALERROR 10200ONERRORLOCAL:T%=FALSE 10210IFT%:SYSswi%,nameread_%,T$TOG% 10220RESTOREERROR:IFT%:PROCerr(15) 10230T%=0:WHILEFNsubname(T%)<>"":T%+=1:ENDWHILE 10240SYSswi%,namewrite_%,T$,B%,-1TOG% 10250WHEN1 10260IFFNsubmax(menusub%-256)<>B%THEN 10270SYSswi%,namewrite_%,T$,B%,menusub%-156TOG% 10280ELSE 10290SYSswi%,sd53_%,menusub%-256TOG% 10300SYSswi%,namewrite_%,T$,G%,menusub%-256TOG% 10310ENDIF 10320ENDCASE 10330PROCmakesubs(file%):PROCshowsub 10340ENDIF 10350PROCclosew(w_nums%):ENDPROC 10360 10370DEFPROCmopen:IFmi%=11PROCclosew(w_open%) 10380IFmi%<>12ENDPROC 10390LOCALI%,m%,d%,r%,p$ 10400p$=$FNia(w_open%,14):PROCwchi(w_open%):I%=q%:REPEAT 10410IF!I%=0:d%=TRUE 10420IF!I%>0AND!I%<9:m%=!I%-1 10430IF!I%=16:r%=TRUE 10440I%+=4:UNTILI%!-4<0:file$=$FNia(w_open%,13):PROCclosew(w_open%) 10450PROCopenfile1(file$,m%,d%,p$,r%):ENDPROC 10460 10470DEFPROCmexpr 10480LOCALA%,T$,c%,s%,u%,I%,Q%,B%:PROCunseli(w_expr%,29) 10490A%=FNia(w_expr%,17):PROCsdfile(dialfile%):PROCqbscan($A%,Q%,B%) 10500CASEmi%OF 10510WHEN2,3,4,5,6,7,8,9 10520IF$A%>""ANDNOTQ%$sd%=MID$("+-*/=<><()",mi%-1,1):IF$sd%<>RIGHT$($A%)T$=$sd% 10530IFmi%=7:IFT$>"":T$+=">" 10540PROCseti(w_expr%,17,$A%+T$) 10550WHEN10,11 10560IF(($A%>""ANDB%>0)ORmi%=10)ANDNOTQ%:$sd%=MID$("()",mi%-9,1):PROCseti(w_expr%,17,$A%+$sd%) 10570WHEN12,13 10580T$=$A%:IF$A%>""ANDNOTQ%THEN 10590$sd%=RIGHT$($A%):SYSswi%,upper_% 10600IF($sd%>="A"AND$sd%<="Z")OR($sd%>="0"AND$sd%<="9")T$+=" " 10610IFmi%=12T$+="AND"ELSET$+="OR" 10620ENDIF 10630PROCseti(w_expr%,17,T$) 10640WHEN14:IF$A%>""ANDNOTQ%T$=$A%+"=""**""":PROCseti(w_expr%,17,T$):PROCsetct(w_expr%,17,LEN$A%-2) 10650WHEN15:IF$A%>""ANDNOTQ%T$=$A%+"~=""""":PROCseti(w_expr%,17,T$):PROCsetct(w_expr%,17,LEN$A%-1) 10660WHEN20,21:PROCsubs 10670WHEN22:PROCnodial 10680WHEN26:PROCnofilt:PROCnodial 10690WHEN29:IF$A%=""PROCseti(w_expr%,17,ex$):ELSEex$=$A%:PROCseti(w_expr%,17,"") 10700WHEN23 10710PROCwchi(w_expr%):I%=q%:REPEAT 10720CASE!I%OF 10730WHEN1:s%=TRUE 10740WHEN0:u%=TRUE 10750WHEN28:c%=TRUE 10760ENDCASE 10770I%+=4:UNTILI%!-4=-1 10780PROCconv($A%):IFu%:PROCupplit($A%) 10790PROCseti(w_expr%,17,$A%) 10800CASEdialreason%OF 10810WHEN0:PROCsetfilt 10820WHEN1:PROCsearch 10830WHEN2:PROCrset2 10840ENDCASE 10850PROCnodial 10860ENDCASE 10870PROCiconupd(w_expr%,17) 10880ENDPROC 10890 10900DEFPROCmstatus 10910LOCALT%,I%,A% 10920CASEmi%OF 10930WHEN15,16,17,18,19,20,21,22 10940T%=FNstatf:IFT%>=0PROCfront(w%(T%,0),-1,-1):ELSEENDPROC 10950WHEN12 10960WHEN13 10970sound%=FALSE:shadows%=FALSE:pix%=FALSE 10980PROCwchi(w_status%):I%=q%:REPEAT 10990CASE!I%OF 11000WHEN24:sound%=TRUE 11010WHEN25:shadows%=TRUE 11020WHEN23:A%=TRUE 11030WHEN28:pix%=TRUE 11040ENDCASE 11050I%+=4:UNTILI%!-4<0 11060IFsound%:SYSswi%,opt_%,10TOG%:ELSESYSswi%,opt_%,9TOG% 11070ENDIF 11080IFA%<>stopboxes%THEN 11090IFA%stopboxes%=TRUE:ELSEPROCstop(20,rl$+"disable these","stop boxes ?",-1):ENDPROC 11100ENDIF 11110OTHERWISEENDPROC 11120ENDCASE 11130PROCclosew(w_status%):ENDPROC 11140 11150DEFPROCmtransfer 11160CASEmi%OF 11170WHEN15:PROCdotransfer 11180WHEN2:IFw%(source%,0)>0:PROCfront(w%(source%,0),-1,-1) 11190WHEN4:IFw%(target%,0)>0:PROCfront(w%(target%,0),-1,-1) 11200WHEN16:PROCendtransfer 11210WHEN-1:PROCfront(w_transfer%,-1,-1) 11220ENDCASE 11230ENDPROC 11240 11250DEFPROCmtransexp:IFmi%<>3ANDmi%<>4ENDPROC 11260IFmi%=3:LOCALT$:T$=FNs($FNia(w_transexp%,1)):PROCsetexp(T$) 11270PROCclosew(w_transexp%):ENDPROC 11280 11290DEFPROCsetexp(T$) 11300IFT$=""THEN 11310fd$(expfield%)="":fd%(expfield%)=0 11320ELSE 11330PROCsdfile(source%) 11340t$=FNx8(T$):fdx$(expfield%)=t$ 11350LOCALERROR:ONERRORLOCAL:RESTOREERROR:menufield%=expfield%:PROCerr(204) 11360SYSswi%,sd59_%,T$TOG% 11370IFG%=-1:PROCerr(205) 11380RESTOREERROR 11390IFG%<0THEN 11400fd%(expfield%)=G%AND&FFFFFF 11410fd$(expfield%)="@"+FNfname(fd%(expfield%)) 11420ELSE 11430fd%(expfield%)=-1:fd$(expfield%)=T$ 11440ENDIF 11450ENDIF 11460PROCupdexp(expfield%) 11470ENDPROC 11480 11490DEFPROCstartdrag 11500dragreason%=-1:dragbutton%=mb%:menufile%=-1 11510PROCwtof(mh%):IFfile%>=0THEN 11520menufile%=file% 11530CASEwind%OF 11540WHEN0 11550IFfile%=source%ANDNOTFNdeadfile(%1111111101011111)THEN 11560menufield%=FNmousef:IFmenufield%>0dragreason%=3:PROCdragfield 11570ENDIF 11580WHEN1 11590CASEmi%OF 11600WHEN14:IFNOTFNdeadfile(-1):menufield%=-1:dragreason%=3:PROCdragicon(mh%,mi%) 11610WHEN22:IFNOTFNdeadfile(%1111111101111111)dragreason%=1:PROCdragicon(mh%,mi%) 11620ENDCASE 11630WHEN2 11640IFNOTFNdeadfile(%11111111111111110):menusub%=FNitos:IFmenusub%>=0:dragreason%=2:PROCdragicon(mh%,mi%) 11650WHEN4 11660IFfile%=source%THEN 11670menufield%=my%:PROCformstat:PROCyconv(menufield%,FNv_(7),mh%) 11680dragreason%=3:PROCdragfield1 11690ENDIF 11700WHEN6:IFmi%<19:dragreason%=6:menufield%=mi%:PROCdragicon(mh%,mi%) 11710ENDCASE 11720ELSE 11730CASEmh%OF 11740WHENw_save%:IFmi%=3:dragreason%=5:PROCdragicon(w_save%,3) 11750ENDCASE 11760ENDIF 11770ENDPROC 11780 11790DEFPROCenddrag 11800PROCreadpointer:IFmenufile%>=0:PROCsdfile(menufile%) 11810IFmh%<>-1THEN 11820CASEdragreason%OF 11830WHEN1:PROCcarddr 11840WHEN2:PROCsubsdr 11850WHEN3:PROCfielddr 11860WHEN4:PROCcarddr1 11870WHEN5:PROCsavereq(FNleaf($FNia(w_save%,2)),savet%,saves%,savereason%,savefile%) 11880WHEN6:PROCnotedr 11890ENDCASE 11900ENDIF 11910dragreason%=-1:menufile%=-1 11920ENDPROC 11930 11940DEFPROCunseli(h%,i%):PROCiset(h%,i%,&200000,0):ENDPROC 11950DEFPROCseli(h%,i%):PROCiset(h%,i%,&200000,&200000):ENDPROC 11960DEFPROCshadei(h%,i%):PROCiset(h%,i%,&400000,&400000):ENDPROC 11970 11980DEFPROCunselall(h%) 11990LOCALI%,i%:PROCwchi(h%) 12000I%=q%:REPEAT:i%=!I%:IFi%>=0:PROCunseli(h%,i%) 12010I%+=4:UNTILi%<0:ENDPROC 12020 12030DEFPROCwchi(h%):SYS"Wimp_WhichIcon",h%,q%,&200000,&200000 12040ENDPROC 12050 12060DEFPROCmenu 12070PROCwtof(mh%):menufile%=file%:IFfile%>=0THEN 12080CASEwind%OF 12090WHEN0,1:PROCcardmenu 12100WHEN5:PROCpop(m_index%,-1) 12110WHEN6:PROCpop(m_npad%,-1) 12120WHEN7:PROCpop(m_macro1%,-1) 12130ENDCASE 12140ELSE 12150CASEmh%OF 12160WHEN-2:my%=64+7*44:menufile%=-1:PROCpop(m_main%,-1) 12170WHENw_status%:PROCstatmenu 12180WHENw_transfer%:PROCpop(m_transfer%,-1) 12190ENDCASE 12200ENDIF 12210ENDPROC 12220 12230DEFPROCcardmenu 12240IFNOTFNflg(f_pane%)ANDFNdeadfile1(%11111111101111110)PROCready:ENDPROC 12250IFs%(file%)<>0ORFNv_(15)<>0:IFFNdeadfile(%11111111101111110)ENDPROC 12260PROCpop(m_card%,-1):ENDPROC 12270 12280DEFPROCstatmenu:menufile%=FNstatf:IFmenufile%<0:ENDPROC 12290PROCpop(m_status%,-1):ENDPROC 12300 12310DEFFNpar(t$,s$,RETURN i%):LOCALi1% 12320i1%=i%+1:i%=INSTR(t$+s$,s$,i1%) 12330=MID$(t$,i1%,i%-i1%) 12340 12350DEFFNcrmenu(menu$) 12360IFmenufree%+28>menuend%ERROR99,"Menu area full" 12370LOCAL m% 12380menuptr%=menufree% 12390i%=0 12400IF LEFT$(menu$,1)="#"i%=1:menutitle$=FNpar(menu$,",",i%)ELSEmenutitle$="" 12410$menuptr%=menutitle$ 12420menuptr%?12=7:menuptr%?13=2:menuptr%?14=7:menuptr%?15=0 12430menuptr%!16=196-24:menuptr%!20=44:menuptr%!24=0 12440menuptr%+=28:maxx%=LENmenutitle$ 12450REPEATitem$=FNpar(menu$,",",i%) 12460PROCmenuitem(item$) 12470UNTIL item$="" 12480m%=menufree%:m%!16=(maxx%*8+6)*2 12490menufree%=menuptr% 12500=m% 12510 12520DEFPROCmenuitem(text$) 12530IFtext$=""menuptr%!-24=(menuptr%!-24)OR&80:ENDPROC 12540IFmenuptr%+24>menuend%THENERROR99,"Menu area full" 12550LOCALi%,flg% 12560flg%=&00 12570i%=INSTR(text$,">") 12580IFi%>0subptr%=EVALMID$(text$,i%+1):text$=LEFT$(text$,i%-1)ELSEsubptr%=-1 12590i%=INSTR(text$,"}") 12600IFi%>0subptr%=EVALMID$(text$,i%+1):text$=LEFT$(text$,i%-1):flg%+=&08 12610IFRIGHT$(text$,1)="#"text$=LEFT$(text$):flg%+=&02 12620menuptr%!0=flg%:menuptr%!4=subptr%:menuptr%!8=&07000021 12630IFLEFT$(text$,1)="$"THEN 12640!menuptr%+=&04:menuptr%!8+=&100:i%=INSTR(text$,"(") 12650IFi%>0THENL%=VALMID$(text$,i%+1):text$=LEFT$(text$,i%-1)ELSEL%=12 12660menuptr%!12=EVALMID$(text$,2):menuptr%!16=-1:menuptr%!20=L% 12670text$=STRING$(L%," ") 12680ELSE 12690IFLENtext$<=12THEN 12700$(menuptr%+12)=text$ 12710ELSE 12720I%=FNworkspace(LENtext$+1):$I%=text$ 12730menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=LENtext$+1 12740menuptr%!8=menuptr%!8 OR &100 12750ENDIF 12760IFLENtext$>maxx%maxx%=LENtext$ 12770ENDIF 12780menuptr%+=24 12790ENDPROC 12800 12810DEFFNworkspace(L%) 12820IF curbuf%+L%>endbuf%ERROR99,"No more buffer space" 12830curbuf%+=L%:=curbuf%-L% 12840 12850DEFPROCprep(menu%,tree%) 12860LOCALI%,T$ 12870PROCclearts(menu%):IFmenufile%>=0:PROCsdfile(menufile%) 12880CASEmenu%OF 12890WHENm_card%:PROCmp_card 12900WHENm_macro1%:PROCmp_macro1 12910WHENm_wind%:PROCmp_wind 12920WHENm_npad%:PROCmp_npad 12930WHENm_main%:PROCmp_main 12940WHENm_status%:PROCmp_status 12950WHENm_report%:PROCmp_report 12960WHENm_rtype%:PROCmp_rtype 12970WHENm_rset1%:PROCmp_rset1 12980WHENm_index%:PROCmp_index 12990WHENm_transfer%:PROCmp_transfer 13000ENDCASE 13010ENDPROC 13020 13030DEFPROCmp_transfer 13040IFFNv_(1)<>4:PROCshade(menu%,0):PROCshade(menu%,2):PROCshade(menu%,3):PROCshade(menu%,4) 13050IFw%(target%,0)<=0PROCshade(menu%,1) 13060PROCsaveset(f_tf$,&D7B,200,-1,SUMLENfd$()+maxfields%*2+200) 13070ENDPROC 13080 13090DEFPROCmp_index:LOCALI% 13100menuindex%=my%:PROCyconv(menuindex%,FNnindices,mh%) 13110IFFNnindices<=0:FORI%=0TO2:PROCshade(menu%,I%):NEXT 13120ENDPROC 13130 13140DEFPROCmp_card 13150LOCALT%:T%=menu%+28+0*24+4 13160IFmenufile%=target%THEN 13170PROCshade(menu%,0) 13180ELSE 13190PROCshade(menu%,2) 13200IFFNflg(f_pane%):PROCtick(menu%,0):!T%=-1:ELSE:!T%=w%(file%,1) 13210ENDIF 13220IFFNmacmode:PROCtick(menu%,1) 13230IFFNdefon:PROCtick(menu%,2) 13240PROCprep(m_wind%,tree%):ENDPROC 13250 13260DEFPROCmp_macro1 13270CASEFNmacmode OF 13280WHENf_macb%:PROCtick(menu%,0) 13290WHENf_mace%:PROCtick(menu%,0) 13300ENDCASE 13310PROCsaveset(f_mc$,&FFF,6,menufile%,80*30) 13320ENDCASE 13330ENDPROC 13340 13350DEFPROCmp_file:IFFNv_(1)<4:PROCshade(menu%,3) 13360IFFNreadonly:PROCshade(menu%,0):PROCshade(menu%,1):PROCshade(menu%,2) 13370ENDPROC 13380 13390DEFPROCmp_wind 13400LOCALI%:FORI%=0TOmaxw%-2:IFw%(file%,I%+2)>0PROCtick(menu%,I%+(I%>0)) 13410IFmenufile%=target%PROCshade(menu%,0):PROCshade(menu%,2) 13420NEXT:ENDPROC 13430 13440DEFPROCmp_status:$menu%=FNfilename 13450SYSswi%,sd57_%,"type"TOG% 13460IFG%<>id_wcia%ANDG%<>id_bbc%ANDG%<>id_exb%:PROCshade(menu%,1):PROCshade(menu%,2) 13470SYSswi%,sd57_%,"bit7"TOG% 13480IFG%=0PROCtick(menu%,4) 13490ENDPROC 13500 13510DEFPROCmp_nums 13520IFFNnnums=10:PROCshade(menu%,0) 13530IFmenusub%<255:PROCshade(menu%,2):PROCshade(menu%,1) 13540ENDPROC 13550 13560DEFPROCmp_npad 13570PROCsaveset(f_np$,&FFF,5,menufile%,80*19) 13580ENDPROC 13590 13600DEFPROCmp_main 13610IFw_transfer%>0PROCtick(menu%,1) 13620IFFNv_(1)>0:PROCshade(menu%,3):PROCshade(menu%,5):IFFNv_(1)>2:PROCshade(menu%,2) 13630ENDPROC 13640 13650DEFPROCpop(menu%,tree%):IFprocess%>0:ENDPROC 13660IFmenu%<0:ENDPROC 13670PROCprep(menu%,tree%) 13680SYS"Wimp_CreateMenu",,menu%,mx%-50,my%+32 13690openmenu%=menu% 13700ENDPROC 13710 13720DEFPROCnomenu 13730SYS"Wimp_CreateMenu",,-1:menufile%=-1:openmenu%=-1 13740ENDPROC 13750 13760DEFPROCnodial:IFdialogue%>0PROCclosew(dialogue%) 13770ENDPROC 13780 13790DEFPROCmenuselect 13800LOCALI% 13810I%=0:REPEATmlist%!I%=q%!I%:I%+=4:UNTILq%!(I%-4)=-1 13820PROCreadpointer:IFmenufile%>=0:PROCsdfile(menufile%) 13830CASEopenmenu%OF 13840WHENm_main%:PROCm_main 13850WHENm_card%:PROCm_card 13860WHENm_npad%:PROCm_npad 13870WHENm_macro1%:PROCm_macro1 13880WHENm_status%:PROCm_status 13890WHENm_index%:PROCm_index 13900WHENm_transfer%:PROCm_transfer 13910ENDCASE 13920IFmb%=1THEN 13930IFmenufile%>=0:PROCsdfile(menufile%) 13940PROCpop(openmenu%,mlist%):ELSEPROCnomenu 13950ENDIF 13960ENDIF 13970ENDPROC 13980 13990DEFPROCm_index 14000CASE!mlist%OF 14010WHEN0,1:PROCselindex(menuindex%,!mlist%) 14020WHEN2:PROCselindex(0,0) 14030ENDCASE 14040ENDPROC 14050 14060DEFPROCm_main 14070CASE!mlist%OF 14080WHEN0:PROCdialogue(w_info%) 14090WHEN1:PROCreadtran:PROCtransfer 14100WHEN2:PROCfastsort 14110WHEN3:PROCcreate 14120WHEN4:PROCstatus 14130WHEN5:PROCpdriver 14140WHEN6:IFFNv_(1)=0:PROCquit(FALSE):ELSEPROCqquit 14150ENDCASE 14160ENDPROC 14170 14180DEFPROCm_transfer 14190CASE!mlist%OF 14200WHEN0:PROCswap 14210WHEN1:PROCtargetopen 14220WHEN2:PROCstop(202,"",rl$+"clear setup?",-1) 14230WHEN3:PROCstop(203,"",rl$+"set defaults?",-1) 14240ENDCASE 14250ENDPROC 14260 14270DEFPROCm_card 14280CASE!mlist%OF 14290WHEN0:PROCswpane 14300WHEN1:PROCswmacro 14310WHEN2:PROCswdefault 14320WHEN3:PROCm_wind 14330ENDCASE 14340ENDPROC 14350 14360DEFPROCm_macro1 14370CASE!mlist%OF 14380WHEN0:fl%(file%)=(fl%(file%)ANDNOTf_macb%)EORf_mace%:PROCshowmac 14390WHEN1:PROCstop(18,fi$+FNfilename,rl$+"clear macro ?",menufile%) 14400ENDCASE 14410ENDPROC 14420 14430DEFPROCm_wind 14440LOCALT%:T%=mlist%!4:T%-=T%>0 14450IFT%>-1ANDT%<maxw%-1:IFw%(file%,T%+2)>0:PROCclosew(w%(file%,T%+2)):ENDPROC 14460CASET%OF 14470WHEN0:PROCsubs 14480WHEN2:PROCfieldlist 14490WHEN3:PROCindex 14500WHEN4:PROCnotepad 14510WHEN5:PROCmacro 14520WHEN6:PROCwtidy 14530ENDCASE 14540ENDPROC 14550 14560DEFPROCm_status:LOCALf%,T%:f%=TRUE 14570CASE!mlist%OF 14580WHEN0:PROCnodial:PROCwalign 14590WHEN1:PROCreadws:PROCnewnotes 14600WHEN2:PROCwritews 14610WHEN3:SYSswi%,sd43_% 14620WHEN4:PROCswap7 14630OTHERWISEf%=FALSE 14640ENDCASE 14650IFf%:PROCnodial 14660ENDPROC 14670 14680DEFPROCm_format 14690CASEmlist%!4OF 14700WHEN-1,0:PROClink 14710WHEN1:PROCcloseform 14720ENDCASE 14730ENDPROC 14740 14750DEFPROCm_npad 14760CASE!mlist%OF 14770WHEN0:PROCstop(17,fi$+FNfilename,rl$+"clear notepad ?",menufile%) 14780WHEN2:PROCnewnotes 14790ENDCASE 14800ENDPROC 14810 14820DEFPROCsubmenu(menu%,X%,Y%,q%) 14830LOCALI% 14840I%=0:REPEATmlist%!I%=q%!I%:I%+=4:UNTILq%!(I%-4)=-1 14850PROCprep(openmenu%,mlist%) 14860SYS"Wimp_CreateSubMenu",,menu%,X%,Y% 14870ENDPROC 14880 14890DEFPROCclearts(mh%):LOCALI%:I%=mh%+28 14900IFmh%<menustart%ORmh%>menuend%:ENDPROC 14910REPEAT 14920!I%=!I%ANDNOT1:I%!8=I%!8ANDNOT&400000: 14930I%+=24:UNTILI%!-24AND&80 14940ENDPROC 14950 14960DEFPROCshade(mh%,I%) 14970mh%!(28+8+24*I%)=mh%!(28+8+24*I%)OR&400000:ENDPROC 14980 14990DEFPROCtick(mh%,I%) 15000mh%!(28+24*I%)=mh%!(28+24*I%)OR&01:ENDPROC 15010 15020DEFFNfiletype(T$) 15030LOCALT%,U%:SYS"OS_File",5,T$ TOU%,,T% 15040IFT%=0:=-1 15050=(T%AND&FFF00)>>8 15060 15070DEFPROCredraw(update%) 15080LOCALh%,T%:IFupdate%THEN 15090SYS"Wimp_UpdateWindow",,q% TO more% 15100ELSE 15110SYS"Wimp_RedrawWindow",,q% TO more% 15120ENDIF 15130h%=!q%:PROCwtof(h%):PROCreadblock(q%+4) 15140WHILE more% 15150T%=FALSE:LOCALERROR:ONERRORLOCAL:T%=TRUE 15160IFT%THEN 15170IFINKEY-3:PROCrectfill(REPORT$):ELSERESTOREERROR:PROCerr(0) 15180ELSE 15190IFfile%>=0THEN 15200CASEwind%OF 15210WHEN0:PROCdrawcard 15220WHEN4:PROCdrawflist 15230WHEN5:PROCdrawilist 15240ENDCASE 15250ELSE 15260ENDIF 15270ENDIF 15280RESTOREERROR 15290!q%=h%:more%=FNnextrectangle 15300ENDWHILE 15310ENDPROC 15320 15330DEFPROCdrawcard 15340CASEs%(file%)OF 15350WHEN0 15360LOCALT%:IFupdate%T%=6:ELSESYSswi%,gline_%:CLG:T%=2 15370PROCgcol(0,7):PROCgcol(0,130+NOTFNflg(f_7bit%)) 15380MOVEbx%+margin%,by%-margin%:SYSswi%,wimp_%,T%,sd$ 15390WHEN1:PROCrectfill("No cards in this subset") 15400WHEN2:PROCrectfill(FNactdesc) 15410ENDCASE 15420ENDPROC 15430 15440DEFPROCdrawflist:LOCALT%:T%=&10000:IFupdate%T%=T%OR1:CLG 15450IFFNv_(7)=0PROCrectfill("No fields in this file"):ENDPROC 15460MOVEbx%+margin%,by%-margin%-4:SYSswi%,wimp_%,T%,sd$ 15470IFfile%=target%THEN 15480LOCALX%,Y%,J% 15490X%=bx%+fwid%:IFX%<=gx1%THEN 15500J%=by%-gy1%-margin%:J%=J%-J%MODlinegap%:Y%=by%-margin%-4-J% 15510J%=(by%-margin%-4-Y%)DIVlinegap%+1 15520REPEAT 15530IFfd$(J%)>""AND16*LENfd$(J%)+X%+32>gx0%MOVEX%,Y%:PRINT"= "fd$(J%); 15540Y%-=linegap%:J%+=1:UNTILY%<gy0% 15550ENDIF 15560ENDIF 15570ENDPROC 15580 15590DEFPROCdrawilist:LOCALT%:T%=&20000:IFupdate%T%=T%OR1 15600IFFNnindices=0PROCrectfill("No indices in this file"):ENDPROC 15610MOVEbx%+margin%,by%-margin%-4:SYSswi%,wimp_%,T%,sd$ 15620ENDPROC 15630 15640DEFFNnextrectangle:LOCALT%:SYS"Wimp_GetRectangle",,q%TOT% 15650PROCreadblock(q%+4):=T% 15660 15670DEFPROCrectfill(T$) 15680PROCgcol(0,3):LOCALI%,J%,L%,X%,Y% 15690L%=LENT$*16+48 15700X%=bx%+margin%:J%=gx0%-X%:X%=X%-J%+J%MODL% 15710J%=by%-gy1%-margin%:J%=J%-J%MODlinegap%:Y%=by%-margin%-4-J% 15720FORJ%=Y%TOgy0%STEP-linegap% 15730MOVEX%,J%:FORI%=X%TOgx1%STEPL%:PRINTT$" - ";:NEXT 15740NEXT:ENDPROC 15750 15760DEFPROCprintcard(T$,Y%,h%) 15770PROCgcol(0,3):LOCALI%,J%,L%,X% 15780L%=LENT$*16+48:J%=ABS(Y%-gy0%)DIVlinegap%+1:IFh%>J%h%=J% 15790X%=bx%+margin%:J%=gx0%-X%:X%=X%-J%+J%MODL% 15800FORJ%=Y%TOY%-h%*linegap%+1STEP-linegap% 15810MOVEX%,J%:FORI%=X%TOgx1%STEPL%:PRINTT$" - ";:NEXT 15820NEXT:ENDPROC 15830 15840DEFFNinbox(X%,Y%,W%,H%) 15850IFW%<0:X%+=W%:W%=-W% 15860IFH%<0:Y%+=H%:H%=-H% 15870IFgx0%>X%+W%:=FALSE 15880IFgx1%<X%:=FALSE 15890IFgy0%>Y%+H%:=FALSE 15900IFgy1%<Y%:=FALSE 15910=TRUE 15920 15930DEFPROCprint(X%,Y%,T$) 15940IFFNinbox(X%,Y%,16*LENT$,-32):MOVEX%,Y%:PRINTT$; 15950ENDPROC 15960 15970DEFFNp(T$):LOCALI%:I%=INSTR(T$,"."):IFI%=0:I%=LENT$+1 15980IFI%>8VDU7:I%=8 15990=VAL(LEFT$(T$,I%-1)+MID$(T$+"000",I%+1,2)) 16000 16010DEFFN`(T%):LOCALT$,S%:S%=SGNT%:T%=ABST%:T$=STR$T% 16020WHILELENT$<3:T$="0"+T$:ENDWHILE 16030=MID$("-",S%+2)+LEFT$(T$,LENT$-2)+"."+RIGHT$(T$,2) 16040 16050DEFPROCwaitpoint 16060waiter%+=1 16070SYS"Hourglass_On" 16080ENDPROC 16090 16100DEFPROCnormpoint 16110WHILEwaiter%>0:SYS"Hourglass_Off":waiter%-=1:ENDWHILE:waiter%=0 16120ENDPROC 16130 16140DEFPROCgcol(m%,c%) 16150SYS"Wimp_SetColour",(m%<<4)+c% 16160ENDPROC 16170 16180DEFPROChelp 16190ENDPROC 16200 16210DEFPROCdataloadack 16220!q%=20:q%!12=ref%:q%!16=4 16230SYS"Wimp_SendMessage",17,q%,task% 16240ENDPROC 16250 16260DEFPROCdatasaveack 16270IFFNArfVar("Wimp$Scrap")="":ERROR99,"<Wimp$Scrap> not defined" 16280!q%=60:q%!12=ref%:q%!16=2:q%!36=-1:$(q%+44)="<Wimp$Scrap>"+CHR$0 16290SYS"Wimp_SendMessage",17,q%,task%:ackref%=q%!8 16300ENDPROC 16310 16320DEFPROCsavereq(T$,t%,s%,r%,f%) 16330savereason%=r%:savefile%=f% 16340q%!32=my%:q%!28=mx%:q%!24=mi%:q%!20=mh% 16350q%!16=1:q%!12=0:q%!36=s%:q%!40=t%:!q%=(LENT$+49)AND&FFFC 16360$(q%+44)=T$+CHR$0:SYS"Wimp_SendMessage",17,q%,mh%,mi% 16370saveref%=q%!8:savetype%=t%:ENDPROC 16380 16390DEFPROCloadmess:PROCreadpointer:IFtask%<0:ENDPROC 16400$(q%+44)=file$+CHR$0:!q%=(LENfile$+49)AND&FFFC 16410q%!12=ref%:q%!16=3:q%!40=savetype% 16420q%!20=mh%:q%!24=mi%:q%!28=mx%:q%!32=my%:q%!36=FNfsize(file$) 16430SYS"Wimp_SendMessage",17,q%,task% 16440ackpending%=TRUE:ENDPROC 16450 16460DEFFNfsize(T$):LOCALT%,s%:T%=OPENINT$:IFT%=0:=0 16470s%=EXT#T%:CLOSE#T%:=s% 16480 16490DEFFNzts(T%):LOCALT$ 16500WHILE?T%<>0:T$+=CHR$?T%:T%+=1:ENDWHILE 16510=T$ 16520 16530DEFPROCkey(h%,icon%,x%,y%,carh%,off%,key%) 16540PROCwtof(h%) 16550LOCALF%:F%=TRUE 16560CASEkey%OF 16570WHEN9,&18A:PROCfindct 16580WHEN13:PROCcursor(h%,icon%,1,0) 16590WHEN19:PROCswapcase 16600WHEN27:IFdialogue%>=0PROCnodial:ELSEF%=FALSE 16610WHEN&181:IFNOTFNprod:PROCquit(TRUE) 16620WHEN&18F:PROCcursor(h%,icon%,-1,off%) 16630WHEN&18E:PROCcursor(h%,icon%,1,off%) 16640WHEN&19F:PROCcursor(h%,icon%,-5,off%) 16650WHEN&19E:PROCcursor(h%,icon%,5,off%) 16660WHEN&1AF,30:PROCcursor(h%,icon%,-1E9,off%) 16670WHEN&1AE:PROCcursor(h%,icon%,1E9,off%) 16680OTHERWISEF%=FALSE 16690ENDCASE 16700IFF%:ENDPROC 16710SYS"Wimp_ProcessKey",key% 16720ENDPROC 16730 16740DEFPROCswapcase:PROCgetct:T%=q%!20+FNia(!q%,q%!4) 16750IF?T%<123AND?T%>96 ?T%-=32:ELSEIF?T%<91AND?T%>64 ?T%+=32 16760PROCgetct:IF?T%>31PROCsetct(!q%,q%!4,q%!20+1) 16770PROCgetct:PROCiconupd(!q%,q%!4):ENDPROC 16780 16790DEFPROCgetct:SYS"Wimp_GetCaretPosition",,q%:ENDPROC 16800 16810DEFPROCsetct(h%,i%,o%):SYS"Wimp_SetCaretPosition",h%,i%,,,-1,o% 16820IFi%>=0PROCfindct 16830ENDPROC 16840 16850DEFFNnumi(h%,i%,b%) 16860RESTORE17030 16870LOCALU%,D%,N%,T%,B%,W%,F%,S%,V% 16880WHILEW%<>-1ANDF%=FALSE 16890PROCreadh(W%):READU%,D%,N%,T%,B% 16900IFW%=h%THEN 16910IFi%=U%ORi%=D%THEN 16920F%=TRUE 16930V%=VAL$FNia(W%,N%) 16940S%=1:IFi%=D%:S%=-1 16950IFb%=1:S%=S%*10 16960V%+=S%:IFV%<B%:V%=B% 16970IFV%>T%V%=T% 16980PROCseti(W%,N%,STR$V%) 16990ENDIF 17000ENDIF 17010ENDWHILE 17020=F% 17030DATA-1,-1,-1,-1,-1,-1,-1 17040 17050DEFPROCcursor(h%,i%,s%,o%) 17060RESTORE17250 17070LOCALW%,T$,I% 17080WHILEW%<>-1 17090PROCreadh(W%):IFW%<>h%THEN 17100IFW%<>-1:REPEAT:READW%:UNTILW%<-1:W%=0 17110ELSE 17120REPEAT 17130READW%:IFW%<>-1:T$+=CHR$(W%) 17140UNTILW%<-1:T$=LEFT$(T$) 17150IFkey%=13:IFASCRIGHT$(T$)=i%:mi%=ABS(W%+100):mb%=1:mh%=h%:PROCselect:ENDPROC 17160IFs%=1E9:s%=LENT$:ELSEIFs%=-1E9:s%=1:ELSEs%+=INSTR(T$,CHR$i%) 17170WHILEs%>LENT$:s%-=LENT$:ENDWHILE 17180WHILEs%<1:s%+=LENT$:ENDWHILE 17190I%=ASCMID$(T$,s%) 17200IFo%>LEN$FNia(h%,I%)o%=LEN$FNia(h%,I%) 17210PROCsetct(h%,I%,o%) 17220ENDIF 17230ENDWHILE 17240ENDPROC 17250DATAw_expr%,17,exi0%,-123 17260DATAw_nums%,2,3,-105 17270DATAw_open%,14,-112 17280DATAw_transexp%,1,-103 17290DATAw_save%,2,-100 17300DATA"w%(file%,6)",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,-100 17310DATA"w%(file%,7)",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,-100 17320DATA-1 17330 17340DEFPROCreadh(RETURN T%) 17350LOCALT$:READT$:IFfile%<0ANDINSTR(T$,"file%")T%=1:ELSET%=EVALT$ 17360ENDPROC 17370 17380DEFFNleaf(T$) 17390LOCALI%,C% 17400IF((INSTR(T$,".")=0)AND(INSTR(T$,":")=0))THEN=T$ 17410I%=LEN(T$) 17420REPEAT 17430C%=ASCMID$(T$,I%,1) 17440I%-=1 17450UNTIL(I%<=0ORC%=ASC"."ORC%=ASC":") 17460IFI%>0THEN=RIGHT$(T$,LEN(T$)-I%-1) 17470=T$ 17480 17490DEFPROCwext(h%,x%,y%):!q%=0:q%!4=-y%:q%!8=x%:q%!12=0 17500SYS"Wimp_SetExtent",h%,q%:PROCforce(h%) 17510PROCgetw(h%):IFopen%THEN 17520IFx1%-x0%>x%:x%+=x0%:ELSEx%=x1% 17530IFy1%-y0%>y%:y%=y1%-y%:ELSEy%=y0% 17540PROCopen(h%,x0%,y%,x%,y1%,scx%,scy%,bhandle%) 17550ENDIF 17560ENDPROC 17570 17580DEFPROCprocess 17590IFdialreason%>=0ORdialogue%>=0ORackpending%>0ENDPROC 17600CASEprocess%OF 17610WHEN1:PROCcheckprot 17620WHEN2:PROCstop(1,"Please place original","MultiStore disk in drive :0",-1):process%+=1 17630WHEN3:PROCcheckprot 17640WHEN4:PROCtransfer:PROCstartopen(0) 17650WHEN5:PROCstartopen(1) 17660OTHERWISEprocess%=0:PROCnewdelay:*unset MultiStore$Function 17670ENDCASE 17680ENDPROC 17690 17700DEFPROCdragicon(h%,i%) 17710LOCALx%,y%,ys%,tx0%,ty0%,tx1%,ty1% 17720PROCgetw(h%):ys%=y1%-y0%:x%=bx%:y%=y0%-scy% 17730PROCgeti(h%,i%):q%!8+=x%:q%!12+=y%+ys%:q%!16+=x% 17740q%!20+=y%+ys%:q%!24=0:q%!28=0:!q%=0:PROCdrag5:ENDPROC 17750 17760DEFPROCdrag5:PROCreadpointer:PROCscrsz:tx0%=mx%-q%!8:ty0%=my%-q%!12 17770q%!24-=tx0%:q%!28-=ty0%:q%!32+=q%!16-mx%:q%!36+=q%!20-my% 17780q%!4=5:SYS"Wimp_DragBox",,q%:ENDPROC 17790 17800DEFFNlower(T$):IFT$="":="" 17810LOCALI%,C% 17820FORI%=1TOLENT$:C%=ASCMID$(T$,I%) 17830IFC%>64ANDC%<91MID$(T$,I%,1)=CHR$(C%+32) 17840NEXT:=T$ 17850 17860DEFPROCwtof(T%) 17870LOCALI%,J% 17880wind%=-1:file%=-1 17890FORI%=0TOmaxf% 17900FORJ%=0TOmaxw% 17910IFw%(I%,J%)=T%:file%=I%:wind%=J%:PROCsdfile(file%):ENDPROC 17920NEXT 17930NEXT:ENDPROC 17940 17950DEFFNformhand(T%):IFf%(T%)>0:=f%(T%):ELSE=h%(T%) 17960 17970DEFPROCfext 17980LOCALx%,y% 17990y%=FNht*linegap%+margin%*2:IFy%<paneh%y%=paneh% 18000x%=FNwd*16+margin%*2:IFx%<22*16x%=22*16 18010PROCwext(w%(file%,0),x%,y%):ENDPROC 18020 18030DEFFNint(t):IFABSt>2E9:=SGNt*2E9:ELSE=t 18040 18050DEFPROCsdfile(T%) 18060LOCALG%:file%=T%:sd$=STR$FNformhand(T%):sdf$=STR$h%(T%):SYSswi%,file_%,sdf$ 18070SYSswi%,sd13_%,0TOG% 18080ENDPROC 18090 18100DEFPROCformstat:SYSswi%,sd13_%,0,sd$TOG% 18110ENDPROC 18120 18130DEFFNbadrec(T%):=(T%AND&7FFFFF00)=&7FFFFF00 18140 18150DEFPROCvalidrec1:PROCvr(FALSE,TRUE) 18160DEFPROCvalidrec2:PROCvr(TRUE,FALSE) 18170DEFPROCvalidrec:PROCvr(TRUE,TRUE) 18180ENDPROC 18190 18200DEFPROCvr(T%,U%) 18210IFfile%=target%THEN 18220SYSswi%,grec_%,0TON% 18230SYSswi%,sd38_%,255 18240SYSswi%,sd38_%,255 18250ELSE 18260PROCsd35:IFG%:IFNOTFNokcard:PROCnewcard(T%,U%):ENDPROC 18270REPEAT 18280IFFNflg(f_macb%)THEN 18290PROCbmacro:PROCsd35:IFG%THEN 18300IFNOTFNokcard:PROCnewcard(T%,U%):ENDPROC:ELSEG%=-1 18310ENDIF 18320ENDIF 18330UNTILG%=0 18340PROCnewcard(T%,U%) 18350ENDIF 18360ENDPROC 18370 18380DEFPROCvalidaterec:PROCvrr(TRUE):ENDPROC 18390DEFPROCvalidaterec1:PROCvrr(FALSE):ENDPROC 18400 18410DEFPROCvrr(T%):PROCsd35:IFG%=0:ENDPROC 18420PROCvr(T%,TRUE):ENDPROC 18430 18440DEFPROCrevalidate 18450IFs%(file%)=1s%(file%)=0:PROCvalidrec2:ELSEPROCvalidaterec 18460PROCforcerep:ENDPROC 18470 18480DEFFNokcard 18490LOCALg% 18500LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCchecksubset:PROCerr(32) 18510*fx229 18520REPEAT 18530PROCvalidr1 18540IFFNbadrec(FNv_(15))g%=0:ELSEPROCsd35:g%=G%:IFG%:PROCsdnext 18550UNTILg%=0:*fx229,1 18560=NOT(FNbadrec(FNv_(15))ANDFNbadrec(FNv_(14))) 18570 18580DEFPROCvalidr1 18590D%=FNv_(14):N%=FNv_(15) 18600IFD%=0ORN%=0THEN 18610SYSswi%,first_%TO,N% 18620PROCsdnext:D%=FNv_(14):N%=FNv_(15) 18630ENDIF 18640IFNOTFNbadrec(D%):ENDPROC 18650IFFNbadrec(N%)THEN 18660CASE N%AND1 OF 18670WHEN 1 18680SYSswi%,first_%TO,N% 18690PROCsdnext 18700WHEN 0 18710SYSswi%,grec_%,FNv_(17)TON% 18720SYSswi%,dir_%,0 18730PROCsd35:IFG%PROCsdnext 18740ENDCASE 18750D%=FNv_(14):N%=FNv_(15) 18760IFNOTFNbadrec(N%):SYSswi%,sd30_%,N%TOG%:D%=FNv_(14) 18770ELSE 18780IFN%>FNv_(17)THEN 18790SYSswi%,first_%TO,N% 18800PROCsdnext 18810ELSE 18820SYSswi%,sd30_%,N%TOG% 18830ENDIF 18840D%=FNv_(14):N%=FNv_(15) 18850ENDIF 18860ENDPROC 18870 18880DEFPROCsd35 18890D%=FNv_(14):N%=FNv_(15) 18900IFN%=0ORD%=0:G%=1:ENDPROC 18910IFFNbadrec(N%)THEN 18920IFFNbadrec(D%):G%=1:ELSEG%=0 18930ELSE 18940SYSswi%,sd35_%,N%TOG% 18950IFG%=0G%=FNfilter 18960ENDIF 18970ENDPROC 18980 18990DEFFNfilter:IFNOTFNflg(f_filt%):=0 19000LOCALERROR 19010ONERRORLOCAL:RESTOREERROR:PROCnofilt:PROCerr(8) 19020IFFNev(fx$(file%),FNflg(f_fspc%),FNflg(f_fupp%)):=0:ELSE=1 19030 19040DEFPROCsdnext 19050SYSswi%,sd23_%TON% 19060REPEAT 19070SYSswi%,next_%TON% 19080IFFNbadrec(N%)ORINKEY0=27G%=0:ELSEPROCsd35 19090UNTILG%=0:ENDPROC 19100 19110DEFPROCfwd:IFFNdeadfile(-1):ENDPROC 19120LOCALn%:SYSswi%,sd23_%TON% 19130SYSswi%,dir_%,1 19140n%=FNv_(15):PROCsdnext:IFFNbadrec(FNv_(15)):SYSswi%,grec_%,n%TON% 19150PROCvalidrec:ENDPROC 19160 19170DEFPROCback:IFFNdeadfile(-1):ENDPROC 19180LOCALn%:SYSswi%,sd23_%TON% 19190SYSswi%,dir_%,0 19200n%=FNv_(15):PROCsdnext:IFFNbadrec(FNv_(15)):SYSswi%,grec_%,n%TON% 19210PROCvalidrec:ENDPROC 19220 19230DEFPROCbof:IFFNdeadfile(-1):ENDPROC 19240SYSswi%,first_%TO,N% 19250PROCsdnext:PROCvalidrec:ENDPROC 19260 19270DEFPROCpause:PROCready:ENDPROC 19280 19290DEFPROCeof:IFFNdeadfile(-1):ENDPROC 19300SYSswi%,grec_%,FNv_(17)TON% 19310PROCvalidrec:ENDPROC 19320 19330DEFPROCcardnum:IFFNdeadfile(-1):ENDPROC 19340SYSswi%,sd23_%TON% 19350PROCchecksubset:ENDPROC 19360 19370DEFPROCgauge:IFFNdeadfile(-1):ENDPROC 19380LOCALT%:PROCgetw(w%(file%,1)) 19390T%=(FNv_(16)+(FNv_(16)>0))*(mx%-x0%)/(326-6)+1:IFT%>FNv_(17)T%=FNv_(17) 19400SYSswi%,sd23_% 19410IFT%=FNv_(15)ENDPROC 19420SYSswi%,grec_%,T%TON% 19430PROCvalidrec:ENDPROC 19440 19450DEFPROCffind:IFFNdeadfile(-1):ENDPROC 19460LOCALT$:T$=$FNia(w%(file%,1),7):PROCstrip(T$):IFT$="":ENDPROC 19470IFINSTR(T$,"=")=0ANDVALMID$(T$,2)>0AND(ASCT$=35ORASCT$=64)THEN 19480CASEASCT$OF 19490WHEN35:SYSswi%,grec_%,VALMID$(T$,2)TON% 19500WHEN64:SYSswi%,locate_%,VALMID$(T$,2)TOD% 19510ENDCASE 19520PROCvalidrec:ENDPROC 19530ENDIF 19540s$(file%)=T$:PROCdup(T$,0):ENDPROC 19550 19560DEFPROCffound 19570PROCseti(w%(file%,1),7,s$(file%)) 19580IFNOTFNbadrec(FNv_(15)):PROCchecksubset:ELSEPROCvalidrec 19590ENDPROC 19600 19610DEFPROCnextmatch:IFFNdeadfile(-1):ENDPROC 19620LOCALT$:IFs$(file%)=""THEN 19630SYSswi%,gfield_%,1 19640SYSswi%,strip_% 19650SYSswi%,upper_% 19660s$(file%)=$sd% 19670ENDIF 19680T$=s$(file%):PROCdup(T$,FNv_(14)):ENDPROC 19690 19700DEFPROCdup1(T$,T%):LOCALf$,t$,I%,d%:d%=FNv_(14) 19710PROCstrip(T$):I%=INSTR(T$,"="):IFI%>0THEN 19720t$=LEFT$(T$,I%-1):T$=MID$(T$,I%+1) 19730IFINSTR(t$,"{")>0ANDRIGHT$(t$)="}"THEN 19740f$=MID$(t$,INSTR(t$,"{")+1):f$=LEFT$(f$) 19750t$=LEFT$(t$,INSTR(t$,"{")-1) 19760ENDIF 19770ENDIF 19780SYSswi%,seek_%,T$,T%,t$,f$TOG% 19790IFG%=0:IFd%>0:IFNOTFNbadrec(d%):SYSswi%,locate_%,d%TOD% 19800ENDPROC 19810 19820DEFPROCdup(T$,T%):PROCdup1(T$,T%) 19830IFG%=0:PROCerr(36) 19840PROCffound:ENDPROC 19850 19860DEFPROCchecksubset 19870SYSswi%,sd23_%TON% 19880PROCsd35:IFG%THEN 19890PROCflg0(f_filt%):SYSswi%,subset_%,0 19900PROCshowfilter:PROCshowsub:PROCforcerep 19910ENDIF 19920PROCvalidrec 19930ENDPROC 19940 19950DEFPROCnewcard(T%,U%) 19960LOCALf%,I%:f%=file% 19970IFs%(file%)=0THEN 19980IF(FNbadrec(FNv_(14))ANDFNbadrec(FNv_(15)))THEN 19990s%(file%)=1:PROCforcecard 20000ELSE 20010IFU%PROCupdate(w%(file%,0)):ELSEPROCforce(w%(file%,0)) 20020ENDIF 20030ENDIF 20040PROCshownum:ENDPROC 20050 20060DEFPROCupdate(h%) 20070!q%=h% 20080CASEh%OF 20090OTHERWISEq%!4=-1E9:q%!8=-1E9:q%!12=1E9:q%!16=1E9 20100ENDCASE 20110PROCredraw(TRUE) 20120ENDPROC 20130 20140DEFFNnnums:LOCALT%,I%:FORI%=0TO9:SYSswi%,sd53_%,I%TOG% 20150IF$sd%>""T%+=1 20160NEXT:=T% 20170 20180DEFFNsubmax(s%):SYSswi%,sd53_%,s%TOG%:IFG%=0:=0 20190WHILE(G%AND1)=0:G%=G%>>>1:ENDWHILE:=G% 20200 20210DEFFNsubnum(T$):LOCALI%:T$=FNsu(T$):IFASCT$=94:T$=FNsu(MID$(T$,2)) 20220IFLENT$=1ANDASCT$>65ANDASCT$<66+FNsubmax(file%)THEN=ASCT$-65 20230FORI%=0TO9:SYSswi%,sd53_%,I%TOG% 20240SYSswi%,upper_% 20250IF$sd%=T$:=I%+256 20260NEXT:=-1 20270 20280DEFFNsubstr:SYSswi%,sd53_%TOG% 20290=$(sd%+16) 20300 20310DEFFNsubname(s%):SYSswi%,sd53_%,s%TOG% 20320=$sd% 20330 20340DEFFNsubdesc:LOCALT$,T%:T%=FNv_(11):IFT%=32T%=0 20350=FNsubdesc1(T%) 20360 20370DEFFNsubdesc1(T%) 20380IFT%=0:="All Cards" 20390IFT%>255:="Numeric: "+FNsubname(T%-256) 20400T$="":IFT%>31:T%=T%AND31:T$="NOT " 20410=T$+"Subset "+CHR$(T%+65) 20420 20430DEFFNsubdesc2(T%) 20440LOCALT$ 20450CASE TRUE OF 20460WHENT%=0ORT%=32:T$="All cards in file" 20470WHENT%>32ANDT%<64 20480T$=d$(file%,T%-33) 20490IFT$="":T$=FNsubdesc1(T%):ELSEIFLENT$<21T$="NOT("+T$+")" 20500WHENT%>0ANDT%<32:T$=d$(file%,T%-1):IFT$="":T$=FNsubdesc1(T%) 20510WHENT%>255:T$="Numeric subset: "+FNsubname(T%-256) 20520OTHERWISET$="" 20530ENDCASE 20540=T$ 20550 20560DEFFNsubdesc3(T%) 20570IFT%>255:=FNsubname(T%-256) 20580IFT%<31:=CHR$(T%+65) 20590="NOT-"+CHR$((T%AND31)+65) 20600 20610DEFFNsubdesc4(T%):IFT%>255:="^"+FNsubname(T%-256) 20620IFT%<31:="^"+CHR$(T%+65) 20630="(^"+CHR$(T%+33)+"=0)" 20640 20650DEFPROCstartopen(T%):PROCwaitpoint 20660LOCALT$:process%+=1 20670T$=FNArfVar("MultiStore$Function") 20680CASEVALT$OF 20690WHEN1:PROCopenst(T%,MID$(T$,3)) 20700ENDCASE 20710PROCnormpoint:ENDPROC 20720 20730DEFPROCready 20740IFa%(file%)<=0THEN 20750CASE TRUE OF 20760WHENFNv_(15)=0:PROCvalidrec 20770ENDCASE 20780ELSE 20790CASEa%(file%)OF 20800WHEN1,2:a%(file%)=0:PROCvalidaterec 20810WHEN3:PROCstop(7,"Searching file "+FNfilename,ri$,file%) 20820WHEN4:PROCstop(9,FNactdesc,ri$,file%) 20830WHEN5,6:PROCstop(13,FNactdesc,ri$,file%) 20840WHEN7:PROCstop(16,FNactdesc,ri$,file%) 20850WHEN8:PROCstop(23,FNactdesc,ri$,file%) 20860WHEN9:PROCstop(24,FNactdesc,ri$,file%) 20870WHEN10:PROCstop(25,FNactdesc,ri$,file%) 20880ENDCASE 20890ENDIF 20900PROCnewdelay:ENDPROC 20910 20920DEFPROCcloseok:IFcopying%>0PROCbuzz1:ENDPROC 20930PROCstop(2,"","Close file "+FNfilename,file%) 20940ENDPROC 20950 20960DEFFNfilename 20970SYSswi%,stat_%TOG% 20980=RIGHT$(FNleaf($sd%),10) 20990 21000DEFFNofilename(I%):IFI%<0:="" 21010LOCALf%,T$:f%=file% 21020PROCsdfile(I%):T$=FNfilename:IFf%>0=PROCsdfile(f%) 21030=T$ 21040 21050DEFPROCswpane 21060PROCflgx(f_pane%):IFFNflg(f_pane%)THEN 21070PROCgetw(w%(file%,0)) 21080PROCopen(w%(file%,0),x0%,y0%,x1%,y1%,scx%,scy%,bhandle%) 21090ELSE 21100PROCgetw(w%(file%,1)) 21110PROCopen(w%(file%,1),x0%,y1%-paneh%,x0%+panew%,y1%,scx%,scy%,-2) 21120PROCclosew(w%(file%,1)) 21130ENDIF 21140ENDPROC 21150 21160DEFPROCforcecard:PROCforce(w%(file%,0)):ENDPROC 21170 21180DEFPROCforcerep:IFw%(file%,3)>0PROCforce(w%(file%,3)) 21190ENDPROC 21200 21210DEFFNdeadfile(f%) 21220LOCALT%:T%=FNdeadfile1(f%):IFT%THEN 21230PROCbuzz 21240ELSE 21250PROCready:T%=FNdeadfile1(f%):IFT%:PROCbuzz 21260ENDIF 21270=T% 21280 21290DEFFNdeadfile1(f%) 21300LOCALI% 21310FORI%=0TO30 21320IFf%AND(2^I%)THEN 21330CASEI%OF 21340WHEN0,1,2,3:IFs%(file%)=I%+1:=TRUE 21350WHEN4:IFa%(file%)<3ANDa%(file%)>0:PROCready:=FALSE:ELSEIFa%(file%)<>0:=TRUE 21360WHEN5:IFFNv_(15)=0:=TRUE 21370WHEN6:IFa%(file%)<>8ANDa%(file%)>2:=TRUE 21380ENDCASE 21390ENDIF 21400NEXT 21410=FALSE 21420 21430DEFFNmacmode=fl%(file%)AND(f_macb%ORf_mace%) 21440 21450DEFFNdefon=(FNhdbyte1(29)AND64)>0 21460 21470DEFFNhdbyte(T%):SYSswi%,sd13_%,T%,sd$TOG% 21480DEFFNhdbyte1(T%):SYSswi%,sd13_%,T%TOG% 21490=G% 21500 21510DEFPROCswmacro 21520IFFNmacmode:PROCflg0(f_macb%):PROCflg0(f_mace%):ELSEPROCflg1(f_mace%) 21530PROCshowmac:ENDPROC 21540 21550DEFPROCswdefault 21560IFFNdefon THEN 21570SYSswi%,default_%,"Off" 21580ELSE 21590SYSswi%,default_%,0 21600ENDIF 21610ENDPROC 21620 21630DEFPROCqbscan(T$,RETURN Q%,RETURN B%) 21640LOCALI%,T%:Q%=FALSE:B%=0:FORI%=1TOLENT$:T%=ASCMID$(T$,I%) 21650IFT%=34:Q%=NOTQ% 21660IFNOTQ%THEN 21670IFT%=ASC"(":B%+=1:ELSEIFT%=ASC")":B%-=1 21680ENDIF 21690NEXT:ENDPROC 21700 21710DEFPROCptrexit(h%) 21720IFsbfile%>=0:PROCsubdisp:sbfile%=-1:PROCnewdelay 21730ENDPROC 21740 21750DEFPROCptrenter(h%) 21760PROCwtof(h%):IFfile%>=0THEN 21770IFwind%=2:sbfile%=file%:PROCsubdisp:PROCnewdelay 21780ENDIF 21790ENDPROC 21800 21810DEFPROCsubdisp1:LOCALsbfile%:sbfile%=file%:PROCsubdisp:ENDPROC 21820 21830DEFPROCsubdisp:IFsbfile%<0:ENDPROC 21840LOCALT$,T%,C%:IFw%(sbfile%,2)<=0:ENDPROC 21850PROCreadpointer:PROCwtof(mh%) 21860T%=&F000000:IFwind%=2ANDfile%=sbfile%:T$=FNsubdesc2(FNitos) 21870C%=&3000000:IFT$=""C%=&7000000:PROCsdfile(sbfile%):T$=FNsubdesc2(FNv_(11)) 21880PROCgeti(w%(sbfile%,2),0) 21890IF(q%!24ANDT%)<>C%:PROCiset(w%(sbfile%,2),0,T%,C%) 21900IFT$<>$FNia(w%(sbfile%,2),0):PROCseti(w%(sbfile%,2),0,T$) 21910ENDPROC 21920 21930DEFPROCsubs 21940IFw%(file%,2)<=0:PROCmakesubs(file%):ENDPROC 21950PROCfront(w%(file%,2),-1,-1) 21960ENDPROC 21970 21980DEFPROCnotepad 21990IFw%(file%,6)<=0:PROCmakenotes(file%):ENDPROC 22000PROCfront(w%(file%,6),-1,-1) 22010ENDPROC 22020 22030DEFPROCmacro 22040IFw%(file%,7)<=0:PROCmakemacro(file%):ENDPROC 22050PROCfront(w%(file%,7),-1,-1) 22060ENDPROC 22070 22080DEFPROCfieldlist 22090IFw%(file%,4)<=0:PROCmakeflist(file%):ENDPROC 22100PROCfront(w%(file%,4),-1,-1) 22110ENDPROC 22120 22130DEFPROCindex 22140IFw%(file%,5)<=0:PROCmakeilist(file%):ENDPROC 22150PROCfront(w%(file%,5),-1,-1) 22160ENDPROC 22170 22180DEFPROCdelicon(h%,i%):!q%=h%:q%!4=i%:SYS"Wimp_DeleteIcon",,q%:ENDPROC 22190 22200DEFPROCloseicon(h%,i%):PROCgeti(h%,i%):PROCdelicon(h%,i%) 22210q%!4=!q%:q%!8=-1E9:q%!12=-1E9:q%!16=-1E9:q%!20=-1E9 22220SYS"Wimp_CreateIcon",,q%+4:ENDPROC 22230 22240DEFPROCcarddr 22250PROCwtof(mh%):IFfile%>=0THEN 22260IFfile%=menufile%THEN 22270CASEwind%OF 22280WHEN2:T%=FNitos:IFT%>0ANDT%<255:PROCsubbyte(T%,-1):PROCvalidaterec 22290ENDCASE 22300ELSE 22310CASEwind%OF 22320WHEN0,1:PROCcopycard 22330ENDCASE 22340ENDIF 22350ELSE 22360CASEmh%OF 22370OTHERWISE:PROCsdfile(menufile%):PROCsavereq("Card",&FFF,FNwd*FNht,1,file%) 22380ENDCASE 22390ENDIF 22400ENDPROC 22410 22420DEFPROCcarddr1 22430tx0%=!q%:tx1%=q%!8:ty0%=q%!4:ty1%=q%!12 22440IFABS(tx0%-tx1%)<10ANDABS(ty0%-ty1%)<10:mb%=1:PROCselect:ENDPROC 22450PROCcxconv(tx0%):PROCcxconv(tx1%):PROCcyconv(ty0%):PROCcyconv(ty1%) 22460IFtx0%>tx1%:SWAPtx0%,tx1% 22470IFty0%>ty1%:SWAPty0%,ty1% 22480PROCsavew(f_cd$,&FFF,2,file%,(tx1%-tx0%+1)*(ty1%-ty0%+1)) 22490ENDPROC 22500 22510DEFPROCfielddr:LOCALf% 22520PROCwtof(mh%):IFfile%>=0THEN 22530CASEwind%OF 22540WHEN4:IFfile%=target%:PROCtargfield 22550OTHERWISE:IFFNenterfield 22560ENDCASE 22570ELSE 22580IFNOTFNenterfield:IFmenufield%>0:IFmenufile%=source%:PROCsavereq("Field",&FFF,255,3,menufile%) 22590ENDIF 22600ENDPROC 22610 22620DEFPROCnotedr 22630PROCwtof(mh%) 22640IFNOTFNenternote:PROCsavereq("Note",&FFF,80,4,menufile%) 22650ENDPROC 22660 22670DEFPROCsubsdr 22680REM ;{{ 22690LOCALT%,T$ 22700PROCsubdisp1:PROCwtof(mh%):IFfile%>=0THEN 22710IFfile%=menufile%THEN 22720CASEwind%OF 22730WHEN0,1:PROCselsub(menusub%) 22740OTHERWISE:IFFNentersub 22750ENDCASE 22760ENDIF 22770ELSE 22780CASEmh%OF 22790OTHERWISE:IFNOTFNentersub 22800ENDCASE 22810ENDIF 22820ENDPROC 22830 22840DEFFNenterfield 22850LOCALW%,T%,T$,t$:RESTORE23450 22860REPEAT:PROCreadh(W%):IFW%<>mh%THEN 22870IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 22880ELSE 22890REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 22900IFW%=mi%THEN 22910CASET%OF 22920WHEN1,4 22930PROCwtof(mh%):IFfile%<0:IFmh%=dialogue%:PROCsdfile(dialfile%) 22940PROCsdfile(menufile%) 22950PROCseti(mh%,mi%,FNaddfield($FNia(mh%,mi%),menufield%)) 22960WHEN6,8:PROCsdfile(menufile%):PROCseti(mh%,mi%,FNaddfield($FNia(mh%,mi%),menufield%)) 22970ENDCASE 22980ENDIF 22990=TRUE 23000ENDIF 23010UNTILW%<0 23020=FALSE 23030 23040DEFFNenternote 23050REM ;{{{ 23060LOCALW%,T%:RESTORE23450 23070REPEAT:PROCreadh(W%):IFW%<>mh%THEN 23080IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 23090ELSE 23100REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 23110IFW%=mi%THEN 23120CASET%OF 23130WHEN1,4,6,7,8 23140IFdragbutton%=64AND(FNthisfile(mh%,menufile%)ORT%=6)THEN 23150IFmi%<>menufield%ORmh%<>w%(menufile%,6)PROCseti(mh%,mi%,$FNia(mh%,mi%)+"'"+CHR$(menufield%+65)) 23160ELSE 23170PROCseti(mh%,mi%,FNnote(menufile%,menufield%)) 23180ENDIF 23190ENDCASE 23200ENDIF 23210=TRUE 23220ENDIF 23230UNTILW%<0 23240=FALSE 23250 23260DEFFNentersub 23270LOCALW%,T%:RESTORE23450 23280REPEAT:PROCreadh(W%):IFW%<>mh%THEN 23290IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 23300ELSE 23310REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 23320IFW%=mi%THEN 23330CASET%OF 23340WHEN1 23350IFFNthisfile(mh%,menufile%)PROCsdfile(menufile%):PROCseti(mh%,mi%,$FNia(mh%,mi%)+FNsubdesc4(menusub%)) 23360WHEN2:PROCsfsub(menusub%) 23370WHEN3:PROCstsub(menusub%) 23380WHEN6:PROCsdfile(menufile%):PROCseti(mh%,mi%,$FNia(mh%,mi%)+FNsubdesc4(menusub%)) 23390ENDCASE 23400ENDIF 23410=TRUE 23420ENDIF 23430UNTILW%<0 23440=FALSE 23450DATAw_expr%,17,1,20,2,21,3,-1,-1 23460DATAw_transexp%,1,8,-1,-1 23470DATA"w%(file%,7)",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,19,1,20,1,21,1,22,1,23,1,24,1,25,1,26,1,27,1,28,1,29,1,-1,-1 23480DATA"w%(file%,6)",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 23490DATA-1 23500 23510DEFPROCnewdelay 23520LOCALI%:delay%=2E9 23530IFprocess%>0:delay%=0 23540FORI%=0TOmaxf%:IFa%(I%)<>0:delay%=0 23550NEXT:IFsbfile%>=0ORcopying%>0:delay%=0 23560ENDPROC 23570 23580DEFPROCsavedata 23590IFq%!12<>saveref%:ENDPROC 23600file$=FNzts(q%+44):PROCsavedata1:ENDPROC 23610 23620DEFPROCsavedata1:PROCclosew(w_save%) 23630IFsavefile%>=0:PROCsdfile(savefile%) 23640outfile%=0:outfile%=OPENOUTfile$:IFoutfile%=0:ENDPROC 23650LOCALERROR 23660ONERRORLOCAL:RESTOREERROR:CLOSE#outfile%:PROCerr(0) 23670CASEsavereason%OF 23680WHEN1:PROCsavecard:PROCnewfn(f_cd$) 23690WHEN2:PROCsavecard1:PROCnewfn(f_cd$) 23700WHEN3:PROCsavefield 23710WHEN4:PROCsavenote 23720WHEN5:PROCsavenotes:PROCnewfn(f_np$) 23730WHEN6:PROCsavemacro:PROCnewfn(f_mc$) 23740WHEN7 23750WHEN8:PROCsavesetup 23760WHEN9 23770WHEN200:PROCsavesetup 23780ENDCASE 23790RESTOREERROR:CLOSE#outfile% 23800OSCLI"settype "+file$+" "+STR$~savetype%:PROCloadmess 23810savereason%=-1:savefile%=-1:PROCnomenu 23820ENDPROC 23830 23840DEFPROCsavecard:IFFNdeadfile(%1111111101111111):ENDPROC 23850LOCALI%:FORI%=1TOFNht:SYSswi%,gline_%,I%,sd$ 23860PROCdprint($sd%):NEXT:ENDPROC 23870 23880DEFPROCsavecard1:IFFNdeadfile(%1111111101111111):ENDPROC 23890LOCALI%:FORI%=ty0%TOty1%:SYSswi%,gline_%,I%,sd$ 23900PROCdprint(MID$($sd%,tx0%,tx1%-tx0%+1)):NEXT:ENDPROC 23910 23920DEFPROCsavefield:PROCdprint(FNs(FNgfield(menufield%))):ENDPROC 23930 23940DEFPROCsavenote:PROCdprint(FNs(FNnote(file%,menufield%))):ENDPROC 23950 23960DEFPROCsavenotes 23970LOCALI%:FORI%=0TO18:PROCdprint(FNs(FNnote(file%,I%))):NEXT:ENDPROC 23980 23990DEFPROCsavemacro 24000LOCALI%:FORI%=0TO29:PROCdprint(FNs(FNmacln(file%,I%))):NEXT:ENDPROC 24010 24020DEFFNitos 24030IFmi%>4ANDmi%<29:=mi%-4+32 24040IFmi%>28ANDmi%<53:=mi%-28 24050IFmi%=1:=0 24060IFmi%>52ANDmi%<63:=mi%-53+256 24070=-1 24080 24090DEFFNmousef:LOCALX%,Y%:X%=mx%:Y%=my%:PROCcyconv(Y%):PROCcxconv(X%) 24100LOCALERROR:ONERRORLOCAL:PROCsdfile(file%):=0 24110SYSswi%,sd52_%,X%,Y%,sd$TOG% 24120PROCsdfile(file%):=G% 24130 24140DEFPROCdragfield:PROCfieldsz(menufield%) 24150!q%=w%(file%,0):q%!8=bx%+tx0%:q%!12=by%+ty0%:q%!16=bx%+tx1% 24160q%!20=by%+ty1%:q%!24=0:q%!28=0:q%!4=5:PROCdrag5:ENDPROC 24170 24180DEFPROCdragfield1:LOCALY% 24190PROCgetw(w%(file%,4)):Y%=by%-menufield%*linegap%-margin%+linegap% 24200q%!8=bx%+margin%:!q%=w%(file%,4):q%!12=Y%-32:q%!16=bx%+ex1%-margin% 24210q%!20=Y%:q%!24=0:q%!28=0:q%!4=5:PROCdrag5:ENDPROC 24220 24230DEFPROCdragcard:IFFNdialogue:ENDPROC 24240!q%=w%(file%,0):PROCgetw(!q%) 24250q%!8=mx%:q%!12=my%:q%!16=mx%:q%!20=my% 24260q%!24=bx%+ex0%+margin%:q%!28=by%+ey1%-margin%-FNht*linegap% 24270q%!32=bx%+ex0%+margin%+FNwd*16 24280q%!36=by%+ey1%-margin%:q%!4=6:SYS"Wimp_DragBox",,q% 24290ENDPROC 24300 24310DEFPROCselsub(s%):IFs%>255ORs%<0:ENDPROC 24320IFs%=FNv_(11)ANDs%(file%)<>1:ENDPROC 24330PROCzfound:SYSswi%,subset_%,s% 24340PROCrevalidate:PROCshowsub:ENDPROC 24350 24360DEFPROCcxconv(RETURN X%):PROCxconv(X%,FNwd,w%(file%,0)):ENDPROC 24370DEFPROCcyconv(RETURN Y%):PROCyconv(Y%,FNht,w%(file%,0)):ENDPROC 24380 24390DEFPROCyconv(RETURN Y%,T%,h%):PROCgetw(h%) 24400Y%=(by%-Y%-margin%)DIVlinegap%+1:IFY%<1Y%=1ELSEIFY%>T%Y%=T% 24410ENDPROC 24420 24430DEFPROCxconv(RETURN X%,T%,h%):PROCgetw(h%) 24440X%=(X%-bx%-margin%)DIV16+1:IFX%<1X%=1ELSEIFX%>T%X%=T% 24450ENDPROC 24460 24470DEFPROCsavew(f$,T%,r%,f%,s%) 24480PROCsaveset(f$,T%,r%,f%,s%) 24490PROCdialogue(w_save%):ENDPROC 24500 24510DEFPROCsaveset(f$,T%,r%,f%,s%) 24520savereason%=r%:savefile%=f%:savet%=T%:saves%=s% 24530PROCseti(w_save%,2,f$):$FNva(w_save%,3)="sfile_"+RIGHT$("00"+STR$~T%,3) 24540ENDPROC 24550 24560DEFPROCCLOSE 24570LOCALI% 24580FORI%=0TOmaxf% 24590IFh%(I%)>0:closeok%=TRUE:PROCclosefile(I%) 24600NEXT:ENDPROC 24610 24620DEFPROCprequit 24630IFFNv_(1)>0PROCackrec:PROCqquit 24640ENDPROC 24650 24660DEFPROCackrec:q%!12=ref%:SYS"Wimp_SendMessage",19,q%,task% 24670DEFPROCqquit:PROCstop(6,"Close files and quit",as$,-1) 24680ENDPROC 24690 24700DEFPROCopenform 24710IFFNdeadfile(%11111111101111110)ENDPROC 24720LOCALT$:T$=FNzts(q%+44) 24730PROCcloseform 24740LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(7) 24750SYSswi%,oform_%,T$ 24760SYSswi%,stat_%,"F"TOG% 24770f%(file%)=-FNv_(2) 24780PROClink 24790ENDPROC 24800 24810DEFPROCcloseform:IFf%(file%)=0:ENDPROC 24820IFf%(file%)>0:PROClink 24830SYSswi%,cform_%,f%(file%)TOS%:f%(file%)=0 24840ENDPROC 24850 24860DEFPROClink 24870f%(file%)=-f%(file%) 24880IFf%(file%)<0THEN 24890SYSswi%,sform_%,h%(file%) 24900ELSE 24910SYSswi%,lform_%,f%(file%),h%(file%) 24920ENDIF 24930PROCsdfile(file%):PROCfext 24940IFw%(file%,4)>0PROCmakeflist(file%) 24950ENDPROC 24960 24970DEFFNgfield(T%) 24980SYSswi%,sd17_%,9,T%,sd$TOG% 24990SYSswi%,gfield_%,$sd% 25000=$sd% 25010 25020DEFFNfname(T%):SYSswi%,sd17_%,9,T%,sd$TOG% 25030=$sd% 25040 25050DEFFNfname1(T%):IFT%<0:="N%":ELSESYSswi%,sd17_%,4,T%,sd$TOG% 25060IF(G%AND7)=7:="@"+FNfname(T%):ELSE="#"+FNfname(T%) 25070 25080DEFFNfnum(T$):SYSswi%,sd67_%,T$,sd$TOG% 25090=G% 25100 25110DEFPROCexpr(r%) 25120dialreason%=r%:dialfile%=file% 25130LOCALT%,T$,A$,t$,s%,u% 25140T$=FNfilename:w_expr%=FNcrwind(tw_expr%):PROCunselall(w_expr%) 25150CASEr%OF 25160WHEN0 25170T$="Filter expression for file "+T$+":" 25180A$=f$(file%):$FNta(w_expr%)="Filter":exi0%=17 25190FORs%=18TO21:PROCloseicon(w_expr%,s%):NEXT 25200PROCloseicon(w_expr%,25):PROCloseicon(w_expr%,27) 25210PROCloseicon(w_expr%,28):s%=FNflg(f_fspc%):u%=FNflg(f_fupp%) 25220ENDCASE 25230PROCseti(w_expr%,16,T$):PROCseti(w_expr%,17,A$):ex$=A$ 25240IFs%PROCseli(w_expr%,1) 25250IFu%PROCseli(w_expr%,0) 25260PROCdialogue(w_expr%):ENDPROC 25270 25280DEFPROCflg0(T%):fl%(file%)=fl%(file%)ANDNOTT%:ENDPROC 25290DEFPROCflg1(T%):fl%(file%)=fl%(file%)ORT%:ENDPROC 25300DEFPROCflgx(T%):fl%(file%)=fl%(file%)EORT%:ENDPROC 25310DEFPROCflgm(M%,F%):fl%(file%)=(fl%(file%)ANDNOTM%)OR(F%ANDM%):ENDPROC 25320DEFPROCflg(T%,F%):fl%(file%)=(fl%(file%)ANDNOTT%)OR((F%<>0)ANDT%):ENDPROC 25330DEFFNflg(T%)=(fl%(file%)ANDT%)<>0 25340 25350DEFPROCsetfilt 25360LOCALT$:T$=FNx1($A%) 25370PROCflg(f_fupp%,u%):PROCflg(f_fspc%,s%):f$(file%)=$A%:fx$(file%)=T$ 25380PROCflg(f_filt%,T$<>""):PROCshowfilter:PROCrevalidate:PROCzfound 25390ENDPROC 25400 25410DEFPROCnofilt:PROCflg0(f_filt%) 25420PROCzfound:PROCrevalidate:PROCshowfilter:ENDPROC 25430 25440DEFFNx1(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(8) 25450DEFFNx2(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(9) 25460DEFFNx3(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(34) 25470DEFFNx4(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(37) 25480DEFFNx5(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(44) 25490DEFFNx6(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(45) 25500DEFFNx7(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(52) 25510DEFFNx8(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(204) 25520=FNx(T$) 25530 25540DEFFNx(A$):PROCstrip(A$):IFA$="":PROCerr(35) 25550LOCALQ%,B%,I%,z$:PROCqbscan(A$,Q%,B%):IFQ%PROCerr(10):ELSEIFB%PROCerr(11) 25560z$=A$:WHILEINSTR(z$,"'"):I%=INSTR(z$,"'") 25570J%=(ASCMID$(z$,I%+1))AND&DF 25580IFJ%<65ORJ%>83:PROCerr(29) 25590IFLENz$+LEN$FNtia(tw%(file%,6),J%-65)>250:PROCerr(30) 25600z$=LEFT$(z$,I%-1)+$FNtia(tw%(file%,6),J%-65)+MID$(z$,I%+2) 25610ENDWHILE:A$=FNX(z$):PROCstrip(A$):IFA$="":PROCerr(35):ELSE=A$ 25620 25630DEFFNX(A$):LOCALz$,J%,I%:z$=A$ 25640WHILEINSTR(A$,"=""*"):I%=INSTR(A$,"=""*") 25650z$=LEFT$(A$,I%-1)+","""+MID$(A$,I%+3) 25660J%=INSTR(z$,CHR$34,I%+2):IFJ%=0:PROCerr(10) 25670IFMID$(z$,J%-1,1)="*":z$=LEFT$(z$,J%-2)+MID$(z$,J%):J%-=1 25680z$=LEFT$(z$,J%)+")"+MID$(z$,J%+1):J%=I% 25690REPEAT:I%=I%-1:IFI%<0:PROCerr(31) 25700UNTILMID$(z$,I%,1)="@" 25710z$=LEFT$(z$,I%-1)+"FNi("+MID$(z$,I%) 25720A$=z$:ENDWHILE:=A$ 25730 25740DEFFNev(A$,s%,u%) 25750$sd%="N":IFs%$sd%+="S" 25760IFu%$sd%+="U" 25770SYSswi%,expand_%,A$,$sd% 25780N%=FNv_(15):D%=FNv_(14) 25790=EVAL$sd% 25800 25810DEFFNev1(A$)=FNev(FNx(A$),macs%,macu%) 25820 25830DEFFNev2(A$,s%,u%)=FNev3(A$,s%,u%,&102050F) 25840 25850DEFFNev5(A$)=FNev(FNx(A$),TRUE,FALSE) 25860 25870DEFFNev3(A$,s%,u%,A%) 25880LOCALU%:LOCALERROR 25890ONERRORLOCAL:RESTOREERROR:@%=&90A:U%=TRUE:IFERR<>6:PROCerr(0) 25900IFU%THEN 25910$sd%=FNev(A$,s%,u%) 25920ELSE 25930@%=A%:$sd%=RIGHT$(" "+STR$FNev(A$,s%,u%),15) 25940IFs%:SYSswi%,strip_% 25950ENDIF 25960@%=&90A:=$sd% 25970 25980DEFPROCwtidy 25990LOCALI%:FORI%=2TOmaxw%:IFw%(file%,I%)>0PROCclosew(w%(file%,I%)) 26000NEXT:ENDPROC 26010 26020DEFPROCbuzz1:SYSswi%,beep_%,100 26030DEFPROCbuzz:SYSswi%,beep_%,150 26040DEFPROCbuzz2:SYSswi%,beep_% 26050ENDPROC 26060 26070DEFPROCsubbyte(T%,g%) 26080IFT%>255THEN 26090SYSswi%,sd53_%,T%-256TOG% 26100SYSswi%,sd51_%,G% 26110ELSE 26120IFT%>31T%-=32:g%=(g%=0) 26130SYSswi%,sd37_%,T%TOG% 26140ENDIF 26150SYSswi%,sd34_%,g%,-1TOG% 26160SYSswi%,sd37_%TOG% 26170ENDPROC 26180 26190DEFPROCzfound:IFfc%(file%)>=0fc%(file%)=-1:PROCshowfound 26200ENDPROC 26210 26220DEFFNactdesc="Transferring cards" 26230 26240DEFPROCendact:IFcopying%=0:ENDPROC 26250s%(source%)=0:a%(source%)=0:s%(target%)=0:copying%=0 26260IFfile%=printer%:PROCreleasepr 26270PROCsdfile(target%):PROCforcecard:SYSswi%,sd38_%,255 26280PROCsdfile(source%):PROCvalidrec2:PROCnewdelay:ENDPROC 26290 26300DEFFNnote(T%,I%):LOCALq%:q%=workbuf%:=$FNtia(tw%(T%,6),I%) 26310 26320DEFPROCnote(T%,I%,T$):LOCALq%:q%=workbuf% 26330IFw%(T%,6)>0PROCseti(w%(T%,6),I%,T$)ELSE$FNtia(tw%(T%,6),I%)=LEFT$(T$,80) 26340ENDPROC 26350 26360DEFFNmacln(T%,I%):IFI%>29:="" 26370LOCALq%:q%=workbuf%:=$FNtia(tw%(T%,7),I%) 26380 26390DEFPROCmacln(T%,I%,T$):LOCALq%:q%=workbuf%:IFI%>29:ENDPROC 26400IFw%(T%,7)>0PROCseti(w%(T%,7),I%,T$)ELSE$FNtia(tw%(T%,7),I%)=LEFT$(T$,80) 26410ENDPROC 26420 26430DEFPROCloadnotes:LOCALI%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 26440WHILENOTEOF#T%ANDI%<19:PROCnote(file%,I%,GET$#T%) 26450I%+=1:ENDWHILE:CLOSE#T%:WHILEI%<19:PROCnote(file%,I%,""):I%+=1:ENDWHILE 26460PROCnoscrap:PROCnewfn(f_np$):PROCnewnotes:ENDPROC 26470 26480DEFPROCloadmacro:LOCALI%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 26490WHILENOTEOF#T%ANDI%<30:PROCmacln(file%,I%,GET$#T%) 26500I%+=1:ENDWHILE:CLOSE#T%:WHILEI%<30:PROCmacln(file%,I%,""):I%+=1:ENDWHILE 26510PROCnoscrap:PROCnewfn(f_mc$):PROCnewnotes:ENDPROC 26520 26530DEFFNsetuptype(f$) 26540LOCALA%,B%,I%,F%,T%,T$:F%=OPENUP(f$):IFF%=0:=-1 26550LOCALERROR 26560PTR#F%=0:FORI%=1TO4:A%=BGET#F%:B%=(A%<<24)+(B%>>8):NEXT 26570IFB%=&55010001:CLOSE#F%:=0 26580IFB%=&6C72654D:B%=BGET#F%:CLOSE#F%:=B% 26590PTR#F%=0:T%=TRUE:ONERRORLOCAL:RESTOREERROR:T%=FALSE 26600IFT%INPUT#F%,T$ 26610IFT%THEN 26620IFT$="Delta+Mailshot Labels":CLOSE#F%:=1 26630IFT$="Delta+Mailshot Wordpro":CLOSE#F%:=2 26640IFT$="Delta+Mailshot Report":CLOSE#F%:=3 26650ENDIF 26660CLOSE#F%:=-1 26670 26680DEFFNsetupdesc(T%) 26690CASET%OF 26700WHEN0:="Printer Driver" 26710WHEN1:="Old Delta+ Labels" 26720WHEN2:="Old Delta+ Wordpro" 26730WHEN3:="Old Delta+ Report" 26740WHEN4:="MultiStore Labels" 26750WHEN5:="MultiStore Wordpro" 26760WHEN6:="MultiStore Report" 26770WHEN7:="MultiStore Transfer" 26780ENDCASE:="Unrecognised Format" 26790 26800DEFPROCclearnpad:LOCALI%:FORI%=0TO18:PROCnote(file%,I%,""):NEXT:ENDPROC 26810 26820DEFPROCclearmacro:LOCALI%:FORI%=0TO29:PROCmacln(file%,I%,""):NEXT:ENDPROC 26830 26840DEFFNthisfile(w%,h%):IFw%=dialogue%:IFh%=dialfile%:=TRUE 26850LOCALI%:FORI%=0TOmaxw%:IFw%(h%,I%)=w%:=TRUE 26860NEXT:=FALSE 26870 26880DEFPROCscrsz 26890!workbuf%=4:workbuf%!4=5:workbuf%!8=11:workbuf%!12=12:workbuf%!16=-1 26900SYS"OS_ReadVduVariables",workbuf%,workbuf%+24 26910q%!32=(workbuf%!32)<<(workbuf%!24):q%!36=(workbuf%!36)<<(workbuf%!28) 26920ENDPROC 26930 26940DEFPROCfindfield:LOCALX%,Y%:IFfile%=edfile%:PROCfedit:ENDPROC 26950PROCgetw(w%(file%,0)):SYSswi%,sd17_%,2,menufield%,sd$TOG% 26960X%=G%:SYSswi%,sd17_%,3,menufield%,sd$TOG% 26970Y%=-G%*linegap%-margin%+linegap%/2:X%=X%*16+margin%-8 26980PROCscrollto(X%,Y%,w%(file%,0)):PROCgetw(w%(file%,0)) 26990MOUSETObx%+X%,by%+Y%:PROCfront(w%(file%,0),-1,-1):ENDPROC 27000 27010DEFPROCscrollto(X%,Y%,h%):IFh%<0ENDPROC:ELSEPROCgetw(h%) 27020IFX%>=x0%-bx%ANDX%<=x1%-bx%ANDY%<=y1%-by%-32ANDY%>=y0%-by%ENDPROC 27030scx%=X%-(x1%-x0%)DIV2:scy%=ABSY%-(y1%-y0%)DIV2 27040IFscx%<0scx%=0 27050IFscy%<0scy%=0 27060PROCopen(h%,x0%,y0%,x1%,y1%,scx%,-scy%,bhandle%) 27070ENDPROC 27080 27090DEFPROCfindct:PROCgetct:PROCscrollto(q%!8,q%!12,!q%):ENDPROC 27100 27110DEFPROCstatus:w_status%=FNcrwind(tw_status%) 27120LOCALI%,T%,T$,s$:s$=STRING$(12," ") 27130PROCunselall(w_status%):T%=0:FORI%=0TOmaxf% 27140IFw%(I%,0)>0THEN 27150PROCsdfile(I%):T$=LEFT$(FNfilename+STRING$(11," "),11) 27160T$+=RIGHT$(s$+STR$FNv_(16),10)+RIGHT$(s$+STR$FNv_(17),11)+" " 27170IFfile%=source%T$+="(SOURCE)":ELSET$+="(TARGET)" 27180IFT%<8:PROCseti(w_status%,T%+15,T$):T%+=1 27190ENDIF 27200NEXT:WHILET%<8:PROCseti(w_status%,T%+15,""):T%+=1:ENDWHILE 27210IFstopboxes%:PROCseli(w_status%,23) 27220IFsound%:PROCseli(w_status%,24) 27230IFshadows%:PROCseli(w_status%,25) 27240IFpix%:PROCseli(w_status%,28) 27250IFsprsz%<=0PROCshadei(w_status%,28) 27260PROCdialogue(w_status%):ENDPROC 27270 27280DEFPROCcopycard:IFcopying%>0ENDPROC 27290LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCcopied:PROCerr(0) 27300PROCsdfile(target%):macro%=FNflg(f_mace%)ORFNflg(f_macb%) 27310PROCcopycd(FALSE) 27320DEFPROCcopied 27330PROCsdfile(target%):SYSswi%,sd38_%,255 27340ENDPROC 27350 27360DEFPROCconv(RETURN T$) 27370PROCstrip(T$):IFASCT$<>63:ENDPROC 27380T$=FNsu(MID$(T$,2)):LOCALT%,Q%,A%,A$,B$ 27390PROCremove(T$,"#"):PROCremove(T$,"@") 27400LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(18) 27410PROCqbscan(T$,Q%,A%):IFQ%PROCerr(10):ELSEIFA%PROCerr(11) 27420T%=INSTR(T$," "):IFT%<2PROCerr(19) 27430A$=LEFT$(T$,T%-1):IFT%>5A$=LEFT$(T$,4) 27440T$=MID$(T$,T%+1) 27450T%=LENT$:Q%=32:IFASCRIGHT$(T$)=34:Q%=34:T%-=1 27460REPEAT:IFT%<1PROCerr(19) 27470T%-=1:UNTILASCMID$(T$,T%+1)=Q% 27480$sd%=FNsu(LEFT$(T$,T%)):T$=MID$(T$,T%+2):IFQ%=34:T$=LEFT$(T$) 27490B$="" 27500IFLEFT$($sd%,5)="SOUND":B$="~=" 27510IFLEFT$($sd%,7)="CONTAIN":B$="=":T$="*"+T$+"*" 27520IFINSTR($sd%,"EQU")>0:B$+="=" 27530IFINSTR($sd%,"IS")>0:B$="="+B$ 27540IFINSTR($sd%,"LESS")>0:B$="<"+B$ 27550IFINSTR($sd%,"GREA")>0:B$=">"+B$ 27560IFINSTR($sd%,"IS")>0:B$=LEFT$(B$):IFB$="":B$="=" 27570IFLENB$<1ORLENB$>2:PROCerr(19) 27580IFRIGHT$(B$)="~":B$=LEFT$(B$)+"=" 27590SYSswi%,sd17_%,4,A$,sd$TOG% 27600IF(G%AND7)=7:T$="@"+A$+B$+""""+FNs(T$)+"""":ELSET$="#"+A$+B$+STR$VALT$ 27610IFINSTR($sd%,"NOT"):T$="NOT("+T$+")" 27620ENDPROC 27630 27640DEFPROCremove(RETURN T$,t$):LOCALI% 27650REPEATI%=INSTR(T$,t$):IFI%:T$=LEFT$(T$,I%-1)+MID$(T$,I%+1) 27660UNTILI%=0:ENDPROC 27670 27680DEFPROCdomacro:IFFNdeadfile(%1111111101101101):ENDPROC 27690DEFPROCdomacro1 27700LOCALa%,b%,c%,d%,e%,f%,g%,h%,i%,j%,k%,l%,m%,n%,a$,b$,t1%,t2%,t3%,t4% 27710LOCAL@%,K%,J%,x%,A$,T$,p$,c$ 27720t1%=t%(file%,0):t2%=t%(file%,1):t3%=t%(file%,2):t4%=t%(file%,3) 27730p$="":a$="":b$="":er%=0 27740LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(20) 27750FORer%=0TO29:IFer%=27:VDU26,4:TRACE ON 27760c$=$FNtia(tw%(file%,7),er%) 27770WHILEc$>"" 27780*fx229 27790A$=c$:IFINSTR(c$,":"):A$=LEFT$(c$,INSTR(c$,":")-1) 27800CASE TRUE OF 27810WHEN 42=ASCA$:$sd%=p$:PROCoscli(MID$(c$,2)):p$=$sd% 27820WHENLEFT$(A$,2)="IF" 27830A$=MID$(A$,3):K%=INSTR(A$,"GO"):IFK%=0K%=-INSTR(A$,"THEN") 27840IFK%=0PROCerr(21)ELSE 27850T$=LEFT$(A$,ABSK%-1):IFmacu%PROCupplit(T$) 27860IFFNev1(T$)THEN 27870IFK%>0THEN 27880U%=FNev1(MID$(A$,K%+2)):IFU%<1ORU%>30PROCerr(22) 27890er%=U%-2:c$="" 27900ELSE 27910c$=":"+FNs(MID$(c$,ABSK%+6)) 27920ENDIF 27930ELSE 27940c$="" 27950ENDIF 27960WHENLEFT$(A$,3)="a$=":a$=FNev5(MID$(A$,4)) 27970WHENLEFT$(A$,3)="b$=":b$=FNev5(MID$(A$,4)) 27980WHENLEFT$(A$,4)="PASS":p$=FNev5(MID$(A$,5)) 27990WHENLEFT$(A$,4)="END":er%=999:c$="" 28000WHENLEFT$(A$,3)="REM":c$="" 28010WHENINSTR(A$,"%=")>0:x%=INSTR(A$,"%=") 28020IFx%=3ANDLEFT$(A$,1)="t"THEN 28030J%=VALMID$(A$,2,1):IFJ%<1ORJ%>4PROCerr(33) 28040K%=FNev1(MID$(A$,x%+2)):t%(file%,J%-1)=K% 28050t1%=t%(file%,0):t2%=t%(file%,1):t3%=t%(file%,2):t4%=t%(file%,3) 28060ELSE 28070IFASCMID$(A$,x%-1)<ASC"a"ORASCMID$(A$,x%-1)>ASC"n"PROCerr(23) 28080PROCsetvar(ASCA$-ASC"a",FNev1(MID$(A$,x%+2))) 28090ENDIF 28100WHENLEFT$(A$,1)="@"ORLEFT$(A$,1)="#":x%=INSTR(A$,"="):PROCsetfield 28110WHENLEFT$(A$,1)="^":x%=INSTR(A$,"="):PROCsetsub 28120ENDCASE 28130IFINSTR(c$,":")c$=MID$(c$,INSTR(c$,":")+1):ELSEc$="" 28140*fx229,1 28150ENDWHILE 28160NEXT 28170ENDPROC 28180 28190DEFPROCsetfield:IFFNreadonly:PROCbuzz1:ENDPROC 28200LOCALT$,exp$,U%,@%:exp$=A$ 28210IFx%=0PROCerr(24):ELSE:IFx%<3PROCerr(25) 28220T$=MID$(exp$,2,x%-2):SYSswi%,sd17_%,4,T$TOG%:G%=G%AND7:IFG%=0:@%=&100000A:ELSE@%=&102000A+G%*256 28230U%=FALSE:A$=FNx(MID$(exp$,x%+1)):LOCALERROR 28240ONERRORLOCAL:RESTOREERROR:@%=&90A:U%=TRUE:IFERR<>6:PROCerr(0) 28250IFU%:$sd%=FNev(A$,TRUE,FALSE):ELSE$sd%=STR$FNev(A$,TRUE,FALSE) 28260IFNOTU%:RESTOREERROR 28270T$=MID$(exp$,2,x%-2) 28280SYSswi%,pfield_%,T$ 28290ENDPROC 28300 28310DEFPROCsetsub:LOCALT$:IFx%=0PRCerr(26):ELSEIFx%<3PROCerr(27) 28320T$=MID$(A$,2,x%-2):T$=FNsu(LEFT$(T$,4)):a%=FNsubnum(T$) 28330IFa%<=0PROCerr(28):ELSEPROCzfound:IFmacu%PROCupplit(A$) 28340PROCsubbyte(a%,FNev1(MID$(A$,x%+1))):ENDPROC 28350 28360DEFPROCoscli(T$):IFASCT$=42:OSCLIT$:ENDPROC 28370LOCALI%,J%:SYS"Wimp_CommandWindow",1 28380PROCnormpoint:mode%=MODE:MODE12 28390*fx229 28400IFT$=""THEN 28410PROCnovars 28420LOCALERROR 28430ONERRORLOCALIFERR=17ANDT$="":PROCendoscli:ENDPROC:ELSEREPORT:PRINT 28440REPEATT$="":INPUTLINE"*"T$ 28450CASE TRUE OF 28460WHEN ASCT$=63ANDFNv_(1)=0:PRINTEVAL(MID$(T$,2)) 28470WHEN ASCT$=63ANDFNv_(1)>0:PRINTFNev(MID$(T$,2),0,0) 28480OTHERWISEOSCLIT$ 28490ENDCASE 28500UNTILT$="" 28510RESTOREERROR 28520ELSE 28530LOCALERROR 28540ONERRORLOCAL:RESTOREERROR:PROCendoscli:PROCerr(0) 28550TIME=0:OSCLIT$:SYS"OS_Byte",&86TO,I%,J% 28560IFTIME<150ANDI%+J%<>0REPEATUNTILINKEY0<0:PRINT''"Press a key... ";:IFGET 28570ENDIF 28580PROCendoscli:ENDPROC 28590 28600DEFPROCendoscli 28610*fx229,1 28620SYS"Wimp_CommandWindow",-1 28630SYS"Wimp_SetMode",mode%:OFF:PROCforce(-1) 28640ENDPROC 28650 28660DEFPROCemacro:IFFNdeadfile(%1111111101111111):ENDPROC 28670IFNOTFNflg(f_macb%):PROCdomacro 28680PROCforcecardrep:PROCvalidrec:ENDPROC 28690 28700DEFPROCbmacro 28710LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCflg(f_macb%,FALSE):PROCshowmac:PROCforcecardrep:PROCvalidrec:PROCerr(0) 28720PROCdomacro:PROCforcecardrep:ENDPROC 28730 28740DEFPROCfieldsz1(T%):LOCALgx0%,gy0%,gx1%,gy1% 28750DEFPROCfieldsz(T%) 28760LOCALL%,X%,Y%,G%,t% 28770PROCgetw(w%(file%,0)):SYSswi%,sd17_%,1,T%TOL% 28780SYSswi%,sd17_%,2,T%TOX% 28790SYSswi%,sd17_%,3,T%TOY% 28800SYS"OS_ReadModeVariable",-1,5TO,,T% 28810ty0%=(-Y%*linegap%-margin%)ANDNOT((1<<T%)-1) 28820tx0%=X%*16+margin%-16:ty1%=ty0%+linegap%:tx1%=tx0%+L%*16+2 28830ENDPROC 28840 28850DEFPROCupdatefield(T%):LOCALX%,L%:PROCfieldsz(T%) 28860!q%=w%(file%,0):q%!4=tx0%:q%!8=ty0%:q%!12=tx1%:q%!16=ty1%:PROCredraw(TRUE) 28870ENDPROC 28880 28890DEFFNshowbranch:PROCreadpointer:IFmb%<>1ORmi%<>-3:=FALSE 28900LOCALT$,t$:T$=fn$(file%):t$=FNleaf(T$):IFt$=T$:=FALSE 28910OSCLI"*filer_opendir "+LEFT$(T$,LENT$-LENt$-1):=TRUE 28920 28930DEFPROCreadws:LOCALT$,T%,I%,c% 28940c%=FNhdbyte1(53):IFc%<>id_bbc%ANDc%<>id_wcia%ANDc%<>id_exb%:ENDPROC 28950SYSswi%,sd24_% 28960IFc%=id_exb%PROCreadexbws:ENDPROC 28970r$(file%)=FNgs:FORI%=0TO18:PROCnote(file%,I%,LEFT$(FNgs,69)):NEXT 28980e$(file%)=LEFT$(FNgs,70) 28990PROCflg(f_rspc%,FNgb):PROCflg(f_rupp%,FNgb) 29000PROCflg(f_sspc%,FNgb2):PROCflg(f_supp%,FNgb2) 29010T%=FNv_(7)+5:IFT%>30ORc%=id_wcia%T%=30 29020FORI%=0TOT%:PROCmacln(file%,I%,FNgs):NEXT 29030SYSswi%,sd25_%TOG% 29040IFG%=11:PROCflg(f_macb%,TRUE):ELSEIFG%:PROCflg(f_mace%,TRUE) 29050ENDPROC 29060 29070DEFPROCreadexbws:LOCALI%,T% 29080FORI%=0TO18:PROCnote(file%,I%,FNgs):NEXT 29090FORI%=0TO29:PROCmacln(file%,I%,FNgs):NEXT 29100FORI%=0TO23:d$(file%,I%)=FNgs:NEXT:f$(file%)=FNgs:fx$(file%)=FNgs 29110e$(file%)=FNgs:FORI%=0TO14:w$(file%,I%)=FNgs:NEXT:wo%(file%)=FNgw(0) 29120r%(file%)=FNgw(0) 29130fl%(file%)=(fl%(file%)ANDNOTf_save%)OR(FNgw(f_dflt%)ANDf_save%) 29140FORI%=0TO3:t%(file%,I%)=FNgw(0):NEXT:o$(file%)=FNgs:o%(file%,0)=FNgw(0) 29150r$(file%)=FNgs:sr$(file%)=FNgs:l$(file%)=FNgs:lk$(file%)=FNgs 29160lx$(file%)=FNgs 29170FORI%=0TO5:ll%(file%,I%)=FNgw(0):NEXT 29180FORI%=0TO15:lf%(file%,I%)=FNgw(0):NEXT 29190FORI%=0TO4:p%(file%,I%)=FNgw(0):NEXT:FORI%=0TO7:p$(file%,I%)=FNgs:NEXT 29200T%=FNgw(0):FORI%=0TOT% 29210IFI%<=maxcol%THEN 29220c$(file%,I%,0)=FNgs:c$(file%,I%,1)=FNgs:c%(file%,I%)=FNgw(0) 29230ELSE 29240$sd%=FNgs:$sd%=FNgs:!sd%=FNgw(0) 29250ENDIF 29260NEXT 29270st%(file%,0)=VALFNgs:st%(file%,1)=VALFNgs:st%(file%,2)=TIME/100 29280ENDPROC 29290 29300DEFPROCwritews:IFFNreadonly:ENDPROC 29310LOCALT$,I%,c% 29320c%=FNhdbyte(&35):IFc%<>id_bbc%ANDc%<>id_wcia%ANDc%<>id_exb%:ENDPROC 29330SYSswi%,sd24_% 29340IFc%=id_exb%:PROCwriteexbws:ENDPROC 29350$sd%=r$(file%):SYSswi%,sd28_% 29360FORI%=0TO18:$sd%=FNnote(file%,I%):SYSswi%,sd28_%:NEXT:$sd%=e$(file%):SYSswi%,sd28_% 29370PROCwsb(FNflg(f_rspc%)):PROCwsb(FNflg(f_rupp%)) 29380PROCwsb(FNflg(f_sspc%)):PROCwsb(FNflg(f_supp%)) 29390T%=FNv_(7)+5:IFT%>30ORc%=id_wcia%T%=30 29400FORI%=0TOT%:$sd%=FNmacln(file%,I%):SYSswi%,sd28_%:NEXT 29410T%=0:IFFNflg(f_mace%):T%=1:ELSEIFFNflg(f_macb%):T%=11 29420SYSswi%,sd26_%,T% 29430ENDPROC 29440 29450DEFPROCwriteexbws:LOCALI% 29460FORI%=0TO18:PROCws(FNnote(file%,I%)):NEXT 29470FORI%=0TO29:PROCws(FNmacln(file%,I%)):NEXT 29480FORI%=0TO23:PROCws(d$(file%,I%)):NEXT:PROCws(f$(file%)):PROCws(fx$(file%)) 29490PROCws(e$(file%)):FORI%=0TO14:PROCws(w$(file%,I%)):NEXT 29500PROCwsw(wo%(file%)):PROCwsw(r%(file%)):PROCwsw(fl%(file%)) 29510FORI%=0TO3:PROCwsw(t%(file%,I%)):NEXT:PROCws(o$(file%)) 29520PROCwsw(o%(file%,0)):PROCws(r$(file%)):PROCws(sr$(file%)) 29530PROCws(l$(file%)):PROCws(lk$(file%)):PROCws(lx$(file%)) 29540FORI%=0TO5:PROCwsw(ll%(file%,I%)):NEXT 29550FORI%=0TO15:PROCwsw(lf%(file%,I%)):NEXT 29560FORI%=0TO4:PROCwsw(p%(file%,I%)):NEXT:FORI%=0TO7:PROCws(p$(file%,I%)):NEXT 29570PROCwsw(maxcol%):FORI%=0TOmaxcol% 29580PROCws(c$(file%,I%,0)):PROCws(c$(file%,I%,1)):PROCwsw(c%(file%,I%)) 29590NEXT:st%(file%,1)+=TIME/100-st%(file%,2):st%(file%,2)=TIME/100 29600st%(file%,0)+=1:PROCws(STR$st%(file%,0)):PROCws(STR$st%(file%,1)) 29610ENDPROC 29620 29630DEFFNgb:SYSswi%,sd25_%TOG%:=(G%=11) 29640DEFFNgb2:SYSswi%,sd25_%TOG%:=(G%<>0) 29650DEFFNgs:SYSswi%,sd27_%:=$sd% 29660DEFPROCws(T$):$sd%=T$:SYSswi%,sd28_% 29670DEFPROCwsb(T%):IFT%SYSswi%,sd26_%,11:ELSESYSswi%,sd26_%,0 29680ENDPROC 29690 29700DEFFNgw(A%):LOCALT%,I%:FORI%=0TO3:SYSswi%,sd25_%TOG% 29710T%=T%OR((G%AND255)<<(I%*8)):NEXT:IFT%=&0d0d0d0dT%=A% 29720=T% 29730 29740DEFPROCwsw(T%):LOCALI%:FORI%=0TO3:G%=T%AND255:SYSswi%,sd26_%,G% 29750T%=(T%>>8):NEXT:ENDPROC 29760 29770DEFFNstatf 29780LOCALT%,I%:I%=14:T%=-1:REPEAT:T%+=1:IFT%>maxf%:=-1 29790IFw%(T%,0)>0:I%+=1 29800UNTILI%=mi%:IFw%(T%,0)>0:PROCsdfile(T%):=T%:ELSE=-1 29810 29820DEFPROCwalign:LOCALX%,Y% 29830IFmenufile%<0ENDPROC:ELSEPROCsdfile(menufile%) 29840X%=file%*80+panew%+8:Y%=900-file%*40-paneh% 29850PROCopen(w%(file%,0),X%,Y%,X%+paneh%,Y%+paneh%,0,0,-1) 29860LOCALI%:FORI%=2TOmaxw%:IFw%(file%,I%)>0THEN 29870PROCalign1(file%,I%):PROCopen(w%(file%,I%),tx0%,ty0%,tx1%,ty1%,0,0,-1) 29880ENDIF:NEXT:ENDPROC 29890 29900DEFPROCgrabpr 29910IFprinter%>=0:PROCerr(42):ELSEIFpstream%>0:PROCerr(41) 29920pstream%=OPENOUT("Printer:"):IFpstream%=0:PROCerr(41) 29930printer%=file%:ENDPROC 29940 29950DEFPROCreleasepr:IFpstream%>0:CLOSE#pstream% 29960printer%=-2:pstream%=0:ENDPROC 29970 29980DEFPROCpprint1(T$) 29990LOCALERROR 30000ONERRORLOCAL:RESTOREERROR:SYS"Hourglass_Off":OSCLI"fx229,1":PROCerr(0) 30010SYS"Hourglass_On":*fx229 30020BPUT#pstream%,T$; 30030RESTOREERROR:SYS"Hourglass_Off":*fx229,1 30040ENDPROC 30050 30060DEFPROCpprint(T$):PROCpprint1(T$):PROCpnewl:ENDPROC 30070 30080DEFPROCppage:IFpdriver%:PROCpprint1(PDff$):ELSEPROCpnewl 30090IFNOTmanual%:ENDPROC 30100!q%=99:$(q%+4)="Please load a new sheet of paper into the printer" 30110SYS "Wimp_ReportError",q%,17:ENDPROC 30120 30130DEFPROCpnewl 30140LOCALERROR 30150ONERRORLOCAL:RESTOREERROR:SYS"Hourglass_Off":OSCLI"fx229,1":PROCerr(0) 30160SYS"Hourglass_On":*fx229 30170IFpterm%>0:BPUT#pstream%,13 30180IFpterm%<>1:BPUT#pstream%,10 30190RESTOREERROR:SYS"Hourglass_Off":*fx229,1 30200ENDPROC 30210 30220DEFPROCdprint1(T$):BPUT#outfile%,T$;:ENDPROC 30230 30240DEFPROCdprint(T$):PROCdprint1(T$):PROCdnewl:ENDPROC 30250 30260DEFPROCofont(T%,O%):IFpdriver%PROCoprint1(PDfont$(T%),O%) 30270ENDPROC 30280 30290DEFPROCdnewl:BPUT#outfile%,"":ENDPROC 30300 30310DEFPROConewl(T%):IFT%:PROCdnewl:ELSEPROCpnewl 30320DEFPROCoprint(T$,T%):IFT%:PROCdprint(T$):ELSEPROCpprint(T$) 30330DEFPROCoprint1(T$,T%):IFT%:PROCdprint1(T$):ELSEPROCpprint1(T$) 30340ENDPROC 30350 30360DEFPROCasccard 30370LOCALh%,I%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 30380I%=1:h%=FNht:WHILEI%<=h%ANDNOTEOF#T%:$sd%=GET$#T% 30390SYSswi%,sd00_%,sd%,I% 30400I%+=1:ENDWHILE:CLOSE#T%:SYSswi%,sd38_%,255 30410SYSswi%,sd38_% 30420PROCforcecard:PROCnoscrap:ENDPROC 30430 30440DEFPROCgetpass:w_passw%=FNcrwind(tw_passw%) 30450PROCseti(w_passw%,0,"File "+FNfilename+", password:") 30460PROCseti(w_passw%,1,""):PROCseti(w_passw%,2,""):PROCseti(w_passw%,5,"") 30470PROCdialogue(w_passw%):ENDPROC 30480 30490DEFPROCnewfn(RETURN T$):IFFNu(file$)<>"<WIMP$SCRAP>"T$=file$ 30500ENDPROC 30510 30520DEFPROCreadparams:LOCALI%,F% 30530maxf%=1:maxacr%=4:maxcol%=29:avchar%=65:manual%=FALSE:maxfields%=250 30540stopboxes%=TRUE:sound%=TRUE:shadows%=TRUE:tools%=TRUE:pix%=FALSE 30550clearpass%=TRUE:sprsz%=0:dplen%=66:dpwid%=79 30560f_la$="LabelSet":f_wp$="WordSet":f_rp$="ReportSet":f_tf$="TransSet" 30570f_np$="Notepad":f_mc$="Macro":f_rx$="Report":f_cd$="Card" 30580macs%=TRUE:macu%=TRUE 30590F%=OPENIN(FNdir+"Params") 30600IFF%:WHILENOTEOF#F%:PROCreadparam(GET$#F%):ENDWHILE:CLOSE#F% 30610DIMfd$(maxfields%),fd%(maxfields%),fdx$(maxfields%) 30620pix%=sprsz%>50:PROCreadflags:ENDPROC 30630 30640DEFPROCreadparam(T$) 30650T$=FNs1(T$):IFT$=""ORASCT$=ASC";"ENDPROC 30660LOCALV$,T%,on,off:on=TRUE:T%=INSTR(T$," "):IFT%=0ENDPROC 30670V$=MID$(T$,T%):T$=LEFT$(T$,T%-1):V$=FNs1(V$) 30680T%=INSTR(V$,";"):IFT%V$=LEFT$(V$,T%-1) 30690LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 30700CASEFNlower(T$)OF 30710WHEN"shadow":shadows%=EVALV$ 30720WHEN"stopboxes":stopboxes%=EVALV$ 30730WHEN"sound":sound%=EVALV$ 30740WHEN"tools":tools%=EVALV$ 30750WHEN"fnprinter":f_pd$=V$ 30760WHEN"fnlabel":f_la$=V$ 30770WHEN"fnwordpro":f_wp$=V$ 30780WHEN"fnrepset":f_rp$=V$ 30790WHEN"fnnotepad":f_np$=V$ 30800WHEN"fnmacro":f_mc$=V$ 30810WHEN"fnreport":f_rx$=V$ 30820WHEN"fncard":f_cd$=V$ 30830WHEN"fntransfer":f_tf$=V$ 30840WHEN"clearpass":clearpass%=EVALV$ 30850WHEN"pagelen":dplen%=EVALV$ 30860WHEN"pagewid":dpwid%=EVALV$ 30870WHEN"pictures":sprsz%=EVALV$ 30880WHEN"labels":maxacr%=EVALV$ 30890WHEN"columns":maxcol%=EVALV$-1 30900WHEN"average":avchar%=ASCV$:IFavchar%<32ORavchar%=127avchar%=65 30910WHEN"manual":manual%=EVALV$ 30920WHEN"transfds":maxfields%=EVALV$ 30930WHEN"macroupp":macu%=EVALV$ 30940WHEN"macrospc":macs%=EVALV$ 30950ENDCASE:ENDPROC 30960 30970DEFFNs1(T$):WHILEASCT$=32:T$=MID$(T$,2):ENDWHILE 30980WHILERIGHT$(T$)=" ":T$=LEFT$(T$):ENDWHILE:=T$ 30990 31000DEFPROCswap7:PROCforce(w%(file%,0)) 31010SYSswi%,sd57_%,"bit7"TOG% 31020G%=G%EOR1:SYSswi%,sd58_%,G%,"bit7" 31030SYSswi%,sd57_%,"bit7"TOG% 31040PROCflg(f_7bit%,G%):SYSswi%,sd39_% 31050ENDPROC 31060 31070DEFFNpwcode(T$):IFT$="":="" 31080LOCALA%,B%,I%:FORI%=1TOLENT$ 31090MID$(T$,I%,1)=CHR$(ASCMID$(T$,I%)EOR(I%+173)) 31100NEXT:=T$ 31110 31120DEFFNpicfield(T%):SYSswi%,sd17_%,9,T%,sd$TOG% 31130SYSswi%,upper_% 31140=LEFT$($sd%,3)="PIC"ANDsd%?3>47ANDsd%?3<58 31150 31160DEFFNreadonly:SYSswi%,sd13_%,&E6TOG% 31170=(G%AND32)<>0 31180 31190DEFFNnindices:SYSswi%,sd57_%,"indices"TOG% 31200=G% 31210 31220DEFPROCupplit(RETURN A$):LOCALQ%,I%,C%:IFA$="":ENDPROC 31230FORI%=1TOLENA$:C%=ASCMID$(A$,I%):IFC%=34Q%=NOTQ% 31240IFQ%ANDC%>96ANDC%<123MID$(A$,I%,1)=CHR$(C%-32) 31250NEXT:ENDPROC 31260 31270DEFPROCnewnotes 31280PROCnewfilt:PROCvalidrec:ENDPROC 31290 31300DEFPROCnewfilt 31310LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCnofilt:ENDPROC 31320LOCALT$:T$=FNx1(f$(file%)):fx$(file%)=T$:PROCshowfilter:ENDPROC 31330 31340DEFPROCcreate:LOCALT%,B%,T$ 31350IFFNv_(1)>0PROCerr(100) 31360LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(60) 31370T$=FNdir+"MSCreate":T%=OPENIN(T$):IFT%=0PROCerr(59) 31380B%=BGET#T%:CLOSE#T%:PROCwriteflags:RESTOREERROR 31390ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 31400PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 31410PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 31420IFw_transfer%>0PROCdelw(w_transfer%) 31430PROCnormpoint:*Set MultiStore$Function 1 31440Z%=taskhandle%:PROCnovars:CHAIN(T$):END 31450 31460DEFPROCtransfer 31470IFw_transfer%<0w_transfer%=FNcrwind(tw_transfer%) 31480PROCunselall(w_transfer%) 31490PROCseti(w_transfer%,2,"(NOT OPEN)"):PROCseti(w_transfer%,4,"(NOT OPEN)") 31500IFw%(source%,0)>0:PROCseti(w_transfer%,2,FNofilename(source%)) 31510IFw%(target%,0)>0:PROCseti(w_transfer%,4,FNofilename(target%)) 31520IFtcd%:PROCseli(w_transfer%,0) 31530IFtws%:PROCseli(w_transfer%,10) 31540IFtns%:PROCseli(w_transfer%,11) 31550IFtsb%:PROCseli(w_transfer%,12) 31560PROCfront(w_transfer%,-1,-1):ENDPROC 31570 31580DEFPROCcheckconv(T$):LOCALT%,B% 31590LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#T%:ENDPROC 31600file$=T$:T%=OPENIN(file$):IFT%=0:ENDPROC 31610B%=BGET#T%:IFB%<>234ANDB%<>235:CLOSE#T%:ENDPROC 31620B%=BGET#T%+BGET#T%+BGET#T%+BGET#T%:CLOSE#T% 31630RESTOREERROR 31640IFB%=0B%=ft_form%ELSEB%=ft_data% 31650menufield%=B%:PROCstop(36,"Wrong file type","Convert to MultiStore ?",-1) 31660ENDPROC 31670 31680DEFPROCpdriver:IFFNv_(1)>0PROCerr(103) 31690PROCmstore("1","MultiStore"):ENDPROC 31700 31710DEFPROCendtransfer:IFFNv_(1)=0:PROCclosew(w_transfer%):ENDPROC 31720IFFNv_(1)>0ANDcopying%<=0PROCerr(215) 31730IFcopying%>0:PROCstop(200,"",rl$+"Interrupt transfer",-1) 31740ENDPROC 31750 31760DEFPROCmstore(A$,T$):LOCALT%,B% 31770LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(60) 31780T$=FNdir+T$:T%=OPENIN(T$):IFT%=0PROCerr(59) 31790B%=BGET#T%:CLOSE#T%:IFFNs(A$)>"":OSCLI"*Set MultiStore$Function "+A$ 31800PROCwriteflags:RESTOREERROR 31810ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 31820PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 31830PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 31840IFw_transfer%>0PROCdelw(w_transfer%) 31850PROCnormpoint 31860Z%=taskhandle%:PROCnovars:CHAIN(T$):END 31870 31880DEFPROCopensource(T$):IFT$="":ENDPROC 31890IFw%(source%,0)>0PROCerr(201) 31900opening%=source% 31910IFINKEY-3:PROCopenfile(T$):ELSEPROCopenfile1(T$,0,TRUE,"",FALSE) 31920ENDPROC 31930 31940DEFPROCopentarget(T$):IFT$="":ENDPROC 31950IFw%(target%,0)>0PROCerr(202) 31960opening%=target% 31970IFINKEY-3:PROCopenfile(T$):ELSEPROCopenfile1(T$,7,FALSE,"",FALSE) 31980ENDPROC 31990 32000DEFPROCopenst(T%,T$) 32010LOCALI%:I%=INSTR(T$,","):IFI%=0I%=LENT$+1 32020IFT%=0PROCopensource(LEFT$(T$,I%-1)):ELSEPROCopentarget(MID$(T$,I%+1)) 32030ENDPROC 32040 32050DEFPROCdotransfer:IFcopying%>0ENDPROC 32060IFFNv_(1)<>4PROCerr(200) 32070PROCreadtran:IFtcd%=FALSE ANDtws%=FALSE ANDtns%=FALSE:PROCerr(206) 32080IFtcd%=FALSE ANDtsb%=TRUE:PROCerr(214) 32090copying%=1:PROCsdfile(source%):a%(file%)=1:SYSswi%,first_%TO,N% 32100PROCshownum:PROCwritews 32110IFw%(file%,6)>0PROCclosew(w%(file%,6)) 32120IFw%(file%,7)>0PROCclosew(w%(file%,7)) 32130s%(file%)=2:PROCforcecard 32140PROCsdfile(target%):macro%=FNflg(f_mace%)ORFNflg(f_macb%) 32150PROCselindex(0,0) 32160PROCselsub(0) 32170IFw%(file%,6)>0PROCclosew(w%(file%,6)) 32180IFw%(file%,7)>0PROCclosew(w%(file%,7)) 32190s%(file%)=2:PROCforcecard:PROCnewdelay 32200ENDPROC 32210 32220DEFPROCreadtran:IFw_transfer%<0ENDPROC 32230LOCALI%:tcd%=FALSE:tws%=FALSE:tns%=FALSE:tsb%=FALSE 32240PROCwchi(w_transfer%):I%=q%:REPEAT:CASE!I%OF 32250WHEN0:tcd%=TRUE 32260WHEN10:tws%=TRUE 32270WHEN11:tns%=TRUE 32280WHEN12:tsb%=TRUE 32290ENDCASE 32300I%+=4:UNTILI%!-4<0:ENDPROC 32310 32320DEFFNht:SYSswi%,sd57_%,"height",sd$TOG% 32330DEFFNwd:SYSswi%,sd57_%,"width",sd$TOG% 32340PROCsdfile(file%):=G% 32350 32360DEFPROCdefault 32370LOCALI%,T%,T$:FORI%=0TOmaxfields%:fd$(I%)="":fd%(I%)=0:NEXT 32380IFFNv_(1)=4THEN 32390PROCsdfile(target%) 32400T%=FNv_(7):IFT%>maxfields%T%=maxfields% 32410FORI%=1TOT% 32420PROCsdfile(target%):T$=FNfname(I%):PROCsdfile(source%) 32430fd%(I%)=FNfnum(T$):IFfd%(I%)>0fd$(I%)="@"+FNfname(fd%(I%)) 32440NEXT 32450ENDIF 32460IFw%(target%,4)>0PROCforce(w%(target%,4)) 32470ENDPROC 32480 32490DEFPROCtargfield:LOCALY% 32500Y%=my%:PROCyconv(Y%,FNv_(7),w%(target%,4)):PROCsdfile(source%) 32510fd$(Y%)=FNfname1(menufield%):fd%(Y%)=menufield%:PROCupdexp(Y%):ENDPROC 32520 32530DEFPROCupdexp(Y%) 32540PROCsdfile(target%):IFY%>FNv_(7):ENDPROC 32550!q%=w%(target%,4):q%!4=fwid%:q%!8=-margin%-Y%*linegap%:q%!12=1E9:q%!16=q%!8+linegap%:PROCredraw(TRUE) 32560ENDPROC 32570 32580DEFPROCselindex(I%,f%):LOCALT$:T$="A":IFf%:T$="D" 32590IFI%>0THEN 32600SYSswi%,order_%,I%,T$TON% 32610ELSE 32620SYSswi%,order_%TON% 32630ENDIF 32640PROCshowindex:PROCchkmv:PROCvalidrec:PROCgraph:ENDPROC 32650 32660DEFPROCclrmv:SYSswi%,sd58_%,0,"moved" 32670ENDPROC 32680 32690DEFPROCchkmv:SYSswi%,sd57_%,"moved"TOG% 32700IFG%=0:ENDPROC 32710PROCclrmv:ENDPROC 32720 32730DEFPROCfieldexp:IFFNv_(1)<>4:PROCbuzz:ENDPROC 32740LOCALT$:w_transexp%=FNcrwind(tw_transexp%) 32750PROCseti(w_transexp%,1,fd$(menufield%)) 32760T$=$FNia(w_transexp%,0):T$=LEFT$(T$,32)+FNfname(menufield%)+":" 32770PROCseti(w_transexp%,0,T$):PROCdialogue(w_transexp%):ENDPROC 32780 32790DEFPROCcopynext 32800LOCALERROR 32810ONERRORLOCAL:RESTOREERROR:PROCendact:PROCerr(208) 32820CASEcopying%OF 32830WHEN1:PROCcopyws:copying%+=1 32840WHEN2:PROCcopynums:copying%+=1 32850IFNOTtcd%:PROCendact 32860WHEN3:PROCcopycd(TRUE) 32870ENDCASE 32880ENDPROC 32890 32900DEFPROCcopyws:IFNOTtws%:ENDPROC 32910LOCALT$ 32920LOCALERROR 32930ONERRORLOCAL:RESTOREERROR:PROCerr(207) 32940PROCsdfile(source%):T$=sd$:PROCsdfile(target%) 32950SYSswi%,sd60_%,1,T$,sd$ 32960SYSswi%,sd57_%,"type",T$TOG% 32970SYSswi%,sd58_%,G%,"type" 32980PROCreadws:macro%=FNflg(f_mace%)ORFNflg(f_macb%) 32990ENDPROC 33000 33010DEFPROCcopynums:LOCALI%,T%,T$:IFNOTtns%:ENDPROC 33020LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(209) 33030FORI%=0TO9:PROCsdfile(source%):SYSswi%,sd53_%,I%TOG% 33040T%=G%:T$=$sd%:PROCsdfile(target%):SYSswi%,namewrite_%,T$,T%,I%TOG% 33050NEXT:ENDPROC 33060 33070DEFPROCcopycd(f%):LOCALI%,T%,s$,t$,menufield% 33080LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(210) 33090PROCsdfile(source%):s$=sd$:IFf%PROCsdnext 33100IFFNbadrec(FNv_(15)):PROCendact:ENDPROC 33110PROCshownum:PROCsdfile(target%):T%=FNv_(7):t$=sd$:PROCsdfile(source%) 33120SYSswi%,add_%,t$TON% 33130FORmenufield%=1TOT% 33140CASESGNfd%(menufield%)OF 33150WHEN-1:$sd%=FNfieldval:SYSswi%,pfield_%,menufield%,t$ 33160WHEN1:I%=fd%(menufield%):SYSswi%,gfield_%,I% 33170SYSswi%,pfield_%,menufield%,t$ 33180ENDCASE 33190NEXT 33200IFtsb%THEN 33210SYSswi%,sd33_%,-1TOG% 33220SYSswi%,sd34_%,G%,-1,t$TOG% 33230ENDIF 33240IFmacro%PROCsdfile(target%):PROCdomacro1 33250ENDPROC 33260 33270DEFFNfieldval:LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(204) 33280=FNev2(fdx$(menufield%),0,0) 33290 33300DEFPROCswap:PROCreadtran 33310LOCALT$:T$="1:"+fn$(target%)+","+fn$(source%) 33320PROCCLOSE:OSCLI"*set MultiStore$Function "+T$:process%=4:ENDPROC 33330 33340DEFPROCtargetopen 33350PROCCLOSE:PROCmstore("2:"+fn$(target%),"MultiStore") 33360ENDPROC 33370 33380DEFPROCfastsort:LOCALT$ 33390T$=fn$(target%):IFT$=""T$=fn$(source%) 33400PROCCLOSE:PROCmstore("1:"+T$,"MSFastSort") 33410ENDPROC 33420 33430DEFPROCsavesetup 33440BPUT#outfile%,"Merl";:BPUT#outfile%,7 33450PRINT#outfile%,tcd%,tws%,tns%,tsb% 33460FORI%=1TOmaxfields%:PRINT#outfile%,fd$(I%):NEXT 33470ENDPROC 33480 33490DEFPROCchecksetup:IFFNsetuptype(file$)<>7PROCerr(211) 33500IFFNv_(1)<>4:PROCerr(212) 33510PROCstop(201,"",rl$+"load setup?",-1):ENDPROC 33520 33530DEFPROCloadsetup:LOCALT%,I%,T$ 33540infile%=OPENINfile$:IFinfile%=0:ENDPROC 33550LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#infile%:PROCerr(213) 33560FORI%=1TO5:T%=BGET#infile%:NEXT 33570INPUT#infile%,tcd%,tws%,tns%,tsb%:PROCtransfer 33580I%=1:WHILEI%<=maxfields%ANDNOTEOF#infile%:INPUT#infile%,T$ 33590expfield%=I%:PROCsetexp(T$):I%+=1:ENDWHILE:CLOSE#infile% 33600RESTOREERROR:WHILEI%<=maxfields%:expfield%=I%:PROCsetexp("") 33610I%+=1:ENDWHILE:ENDPROC 33620 33630DEFPROCclear:FORexpfield%=1TOmaxfields%:PROCsetexp(""):NEXT:ENDPROC 33640 33650DEFPROCreadflags:LOCALT$:T$=FNArfVar("MultiStore$Flags") 33660PROCstrflg(LEFT$(T$,1),sound%):PROCstrflg(MID$(T$,2,1),stopboxes%) 33670PROCstrflg(MID$(T$,3,1),shadows%):PROCstrflg(MID$(T$,4,1),pix%) 33680*unset MultiStore$Flags 33690ENDPROC 33700 33710DEFPROCwriteflags:LOCALT$ 33720T$=FNflgstr(sound%)+FNflgstr(stopboxes%)+FNflgstr(shadows%)+FNflgstr(pix%) 33730OSCLI"*Set MultiStore$Flags "+T$:ENDPROC 33740 33750DEFFNflgstr(T%):IFT%:="*":ELSE="-" 33760 33770DEFPROCstrflg(T$,RETURN T%) 33780IFT$="*":T%=TRUE:ELSEIFT$="-"T%=FALSE 33790ENDPROC 33800 33810DEFPROCreadflags:LOCALT$:T$=FNarfvar("MultiStore$Flags") 33820PROCstrflg(LEFT$(T$,1),sound%):PROCstrflg(MID$(T$,2,1),stopboxes%) 33830PROCstrflg(MID$(T$,3,1),shadows%):PROCstrflg(MID$(T$,4,1),pix%) 33840*unset MultiStore$Flags 33850ENDPROC 33860 33870DEFPROCnovars 33880ENDPROC 33890 33900DEFPROCpicpath:LOCALT$:IFLENfile$>230:ENDPROC 33910T$=FNArfVar("MultiStorePics$Path"):IFINSTR(FNu(T$),FNu(file$)):ENDPROC 33920file$+=".":WHILELENT$+LENfile$>229 33930REPEAT:T$=LEFT$(T$):UNTILRIGHT$(T$)=","ORT$="":T$=LEFT$(T$) 33940ENDWHILE:IFT$>"":file$+="," 33950OSCLI"Set MultiStorePics$Path "+file$+T$ 33960FORI%=0TOmaxf%:IFw%(I%,0)>0PROCforce(w%(I%,0)) 33970NEXT:ENDPROC 33980 33990DEFFNaddfield(T$,T%) 34000LOCALC%,t$,A$:t$=T$:WHILERIGHT$(t$)=" ":t$=LEFT$(t$):ENDWHILE 34010IFt$="":=FNfname1(T%) 34020IFRIGHT$(t$)="@"ORRIGHT$(t$)="#":=t$+FNfname(T%) 34030C%=FALSE:RESTORE+1:REPEAT:READA$:C%=RIGHT$(t$,LENA$)=A$ 34040UNTILC%ORA$="****":IFNOTC%T$+="+" 34050IFINSTR(T$,"@"):=T$+"@"+FNfname(T%) 34060IFINSTR(T$,"#"):=T$+"#"+FNfname(T%) 34070=T$+FNfname1(T%) 34080DATA+,-,*,/,AND,OR,NOT,>,<,=,(,",",":",**** 34090 34100DEFPROCsetvar(A%,V%) 34110CASEA%OF 34120WHEN 0:a%=V% 34130WHEN 1:b%=V% 34140WHEN 2:c%=V% 34150WHEN 3:d%=V% 34160WHEN 4:e%=V% 34170WHEN 5:f%=V% 34180WHEN 6:g%=V% 34190WHEN 7:h%=V% 34200WHEN 8:i%=V% 34210WHEN 9:j%=V% 34220WHEN10:k%=V% 34230WHEN11:l%=V% 34240WHEN12:m%=V% 34250WHEN13:n%=V% 34260ENDCASE 34270ENDPROC
"�> <MultiStore$Dir>.MSTransfer ?� 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 @�10 J�11 T�12 ^�17,18:�umess1 h�19:�umess2 r� |�normpoint �� � �!��quit(T%):�normpoint:�novars �@�(�-3��debug):$q%="TASK":È™"Wimp_CloseDown",taskhandle%,!q% ��T%��debug:�tidy:� �!È™swi%,killtask_%,taskhandle% �Ș � �ݤtask=otask% � ���init:otask%=Z%:�swinums �,appl$="MultiStore":pstream%=0:�releasepr �'� q% 2500, workbuf% 1500,dialct% 24 7waiter%=0:file%=-1:v%=�initwimp:�v%<180:�12:�err(2) !�waitpoint:È›(�dir+"BaseLib") È›(�dir+"SwiList"):�swilist &4quit%=�:dialreason%=-1:dialogue%=-1:dialfile%=-1 0ackpending%=�:ackref%=-1 :dragreason%=-1:help$="" Dsavereason%=-1:savefile%=-1 Nfile2%=-1:reason2%=-1 Xmenufile%=-1:menusub%=-1 bcloseok%=� lsbfile%=-1:pass$="" v-pdriver%=�:È™"OS_Byte",182,0,255 �,pterm% w0�(pterm%�&80)=0È™"OS_Byte",246,0,255�,pterm% � �pterm%=10pterm%=1:�pterm%=2 �$id_wcia%=42:id_exb%=43:id_bbc%=0 �exi0%=-1:exi1%=-1:links%=0 �� edbuf% 256,edval% 15 �Jedfield%=-1:edfile%=-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 �$stopfile%=-1:lastact%=0:chunk%=7 �Ias$="Are you sure ?":rl$="Really ":ri$=rl$+"interrupt ?":fi$="File: " �(sy$="Sorry! ":lastspr$="":copying%=0 �?source%=0:target%=1:tcd%=�:tws%=�:tns%=�:tsb%=�:expfield%=0 �'�23,255,0,126,126,126,126,126,126,0 �baricon:� ��swinums charswi%=&C0000 *� 4 >��filevars H � ;{n R<� ;{n window handles in w%(maxf%,maxw%) - <=0 = Deleted \D� ;{n (,0)=Card (,1)=Pane (,2)=Subsets (,3)=Report fC� ;{n (,4)=Fields (,5)=Indices (,6)=Notepad (,7)=Macro p;� ;{n tw%(maxf%,maxw%) template pointers for windows z2� ;{n h%(maxf%)=File handles 0 = not open �D� ;{n f%(maxf%)=Format handles 0 = not open, -ve = not linked �.� ;{n s%(maxf%)=status (0=card displayed) �2� ;{n (1=no cards in subset) �:� ;{n (2=background action going on) �%� ;{n s$(maxf%)=fast find string �.� ;{n+ d$(maxf%,23)=23 subset descriptions �'� ;{n+ f$(maxf%)=filter expressions �?� ;{n+ fx$(maxf%)=filters after expansion for abbreviations �'� ;{n+ e$(maxf%)=search expressions �8� ;{n+ w$(maxf%,14)=wordprocessor output expressions �� ;{n+ wo%(maxf%) �8� ;{n ex$(maxf%)=search expressions after expansion � � ;{n fn$(maxf%)=file names � ;{n+ r%(maxf%)=report mode I� ;{n a%(maxf%)=background action in this file, -ve=linked to action 8� ;{n e%(maxf%,2)=background activity status stuff: $9� ;{n fc%(maxf%)=fast find, number found last search .$� ;{n fl%(maxf%)=boolean flags: 82� ;{n+ t%(maxf%,3)=global variables for macros B2� ;{n+ l$(maxf%)=link expression for this file LD� ;{n+ lx$(maxf%)=expanded link expression. Also, link file name V� ;{n+ lk$(maxf%)=link key `"� ;{n+ st%(maxf%,2)=file stats j � ;{n t.� ;{n maxf% = max array index (files) ~0� ;{n maxw% = max array index (windows) � � ;{n �'ft_form%=&DE7:ft_data%=&DE8:maxw%=7 �H� w%(maxf%,maxw%),h%(maxf%),f%(maxf%),s%(maxf%),s$(maxf%),fc%(maxf%) �H� fl%(maxf%),a%(maxf%),d$(maxf%,23),f$(maxf%),fx$(maxf%),t%(maxf%,3) �A� tw%(maxf%,maxw%),e$(maxf%),ex$(maxf%),e%(maxf%,2),r%(maxf%) �J� fn$(maxf%),l$(maxf%),lx$(maxf%),lk$(maxf%),w$(maxf%,14),st%(maxf%,2) �H� 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) �� c%(maxf%,maxcol%) �;f_filt%=1<<00:f_pane%=1<<01:f_macb%=1<<02:f_mace%=1<<03 �;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 2[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%) FKf_dflt%=f_fspc%�f_fupp%�f_sspc%�f_supp%�f_stot%�f_stit%�f_sdas%�f_wspc% P� Z d��sdvars nÈ™swi%,sd64_%,3�linegap% xmargin%=8:�v_(1)=1:�err(3) �1�sound%:È™swi%,opt_%,10�G%:�șswi%,opt_%,9�G% �8date%=�nyear(�now)*10000+�nmon(�now)*100+�nday(�now) �� � �-��checkprot:�T%:È™"FlexiFile_Address"�sd% �� ���:process%=2:� �șswi%,reset_%,taskhandle% �W�process%=3�stop(1,"OK. Please remove original &","replace backup if necessary",-1) �<T%=�now:date$=�strdate(�nday(T%),�nmon(T%),�nyear(T%),4) ��sdvars �process%=4:� � ��version /�T$:T$=version$:笤prod:T$+=" *UNFINISHED*" 8�seti(w_pinfo%,4,"v"+T$):$�tia(tw_status%,11)="v"+T$ "� , 6,ݤprod=�version$,�version$,".")+1,1)="0" @#��debug:�-1���prod:�quit(�):�� Jݤdebug=��prod ��-1��-2 T ^>ݤinitwimp:first%=�:taskhandle%=�task:�taskhandle%<>0:=200 hG$q%="TASK":È™"Wimp_Initialise",200,!q%,"MultiStore"�!q%,taskhandle% rfirst%=�:=!q% | � ��tidy ��normpoint ��4,26:�0,2);:*fx4 �*fx225,1 � *fx229 �Z%=0:È™swi%,killtask_% ��:�:�" ";�:�quit(�) �+�;menuend%-menufree%" bytes menu space" �6�;endbuf%-curbuf%" bytes indirection buffer space" �'�;tbe%-tbs%" bytes template buffer" �� � ���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% &� 0 :��strip(� T$) D$sd%=T$:È™swi%,strip_% NT$=$sd% X� b l��upper(� T$) v$sd%=T$:È™swi%,upper_% � 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$+=" ("+Þ+")" �� ���:�error(�,�$,�,�) �9!q%=err%:$(q%+4)=err$:È™"Wimp_ReportError",q%,1,appl$ ��quit%:�quit(�) �� � +��report:�debug:�4:�:�" @ ";�:�quit(�) � ݤdir * �T$:T$=�ArfVar(appl$+"$Dir") 4!�T$="":T$="&.!"+�appl$,9)+"." >��T$)<>".":T$+="." H=T$ R \ݤArfVar(A$):�L%,V% f=È™"XOS_ReadVarVal",A$,workbuf%,254,0,3�,,L%;V%:�V%�1:L%=0 pworkbuf%?L%=13:=$workbuf% z ���umess1 �-ref%=q%!8:task%=q%!4:�task%=taskhandle%:� �mess%=q%!16 �Ȏmess%� ��0:�CLOSE:�quit(�) ��1:�datasaved ��2:�savedata ��3:�dataload ��4:ackpending%=� ��5:�dataopen ��6: ��7: ��8:�prequit �9: �&502: -�&400C0:�submenu(q%!20,q%!24,q%!28,q%+32) $�&80300:�ackrec .� 8� B L��dataopen V(�q%!40=ft_form%:�dataloadack:�err(1) `�q%!40<>ft_data%:� j"�dataloadack:mh%=-1:�checkopen tB�process%=0:笤dialogue:�mstore("2:"+�zts(q%+44),"MultiStore") ~� � �"��checkopen:�v_(1)>0�err(104) �� � ���dataload ��copying%>0�buzz1:� �del%=q%!12<>0 ��readpointer:�wtof(mh%) � ÈŽ � � �U� q%!40=&1000:file$=�zts(q%+44):�stop(38,�file$,29),rl$+" set picture path ?",-1) �� q%!40=ft_data%�mh%=-2 ��dataloadack L�process%=0笤dialogue:�checkopen:�mstore("3:"+�zts(q%+44),"MultiStore") $� q%!40=ft_data%�mh%=w_transfer% )�mi%=1�mi%=2:�opensource(�zts(q%+44)) )�mi%=3�mi%=4:�opentarget(�zts(q%+44)) (� q%!40=&FFD �mh%=-2 23�process%=0:笤dialogue:�checkconv(�zts(q%+44)) <� q%!40=ft_form% F4�dataloadack:�wtof(mh%):�wind%>1�file%<0:�err(1) P �err(203) Zr� q%!40=&FFF �file%>=0�wind%=6:�dataloadack:file$=�zts(q%+44):�stop(14,fi$+�filename,rl$+"load notes ?",file%) dr� q%!40=&FFF �file%>=0�wind%=7:�dataloadack:file$=�zts(q%+44):�stop(19,fi$+�filename,rl$+"load macro ?",file%) n;� q%!40=&D7B:�dataloadack:file$=�zts(q%+44):�checksetup x� �� � � ��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$=" - " @%=&90A:*fx229,1 " ÈŽE%� ,�0:T$=�$ 60�1:T$="To use a format, drag it onto a card" @-�2:T$="Must be version 1.8 WIMP or later" J.�3:T$="Sorry! Too many files already open" TA�4:T$="Sorry! 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" hc�6:T$="Couldn't open file: "+�$:�$="Data lost":T$+=" (Ensure the disc is not write protected)" r%�7:T$="Couldn't open format: "+�$ |#�8:T$="Filter expression"+A$+�$ �#�9:T$="Search expression"+A$+�$ �(�10:T$="Unbalanced quote marks ("")" � �11:T$="Unbalanced brackets" �.�12:T$="No cards to search in this subset" �F�13:T$="The name should be 2-4 characters and start with a letter" �D�14:T$="Please specify the maximum value to store in the subset" �"�15:T$="Subset already exists" �1�16:T$="Field names must start with a letter" �,�17:T$="Copying/combining subsets"+A$+�$ � �18:T$="English query"+A$+�$ �%�19:T$="Can't understand meaning" �'�20:T$="Macro line "+�(er%+1)+A$+�$ �6�21:T$="Missing THEN or GO clause in IF statement" -�22:T$="Invalid macro line number for GO" (�23:T$="Illegal variable assignment" &�24:T$="Field assignment expected" &%�25:T$="Field name not specified" 0-�26:T$="Subset value assignment expected" :-�27:T$="Subset name/letter not specified" D'�28:T$="Invalid subset name/letter" N1�29:T$="Illegal notepad reference identifier" X9�30:T$="Abbreviated expression too complex to expand" b%�31:T$="Illegal pattern matching" l>�32:T$="Validating card"+A$+�$+" (Filter/Subset disabled)" v+�33:T$="Illegal global variable number" �"�34:T$="Sort expression"+A$+�$ �+�35:T$="Expression should not be blank" �7�36:T$="Fast find"+A$+"couldn't find matching card" �"�37:T$="Link expression"+A$+�$ ��38:T$="Link file not open" �-�39:T$="You can't link to an active file" �1�40:T$="You can't have a circular link setup" �#�41:T$="Printer already in use" �9�42:T$="Printer in use by file "+�ofilename(printer%) �2�43:T$="Printing"+A$+�$+" (Report terminated)" �+�44:T$="Simple report definition"+A$+�$ �!�45:T$="Report formula"+A$+�$ �9�46:T$="Exporting report"+A$+�$+" (export cancelled)" E�47:T$="The two new passwords must be identical. Please re-enter" *�48:T$="Not a suitable printer driver" 1�49:T$="You can't load that setup file there" 1�50:T$="Can't recognise format of setup file" *<�51:T$="You must specify the current password correctly" 4>�54:T$="Plotting picture"+A$+�$+" (release ALT to redraw)" >�59:T$="Program not found" H4�60:T$=�$+" - Can't load file creation software" R=�61:T$="Sorry! Not enough subsets available for a search" \2�62:T$=�$+" - Can't load file system software" fI�100:T$=sy$+"You can't create a file/format while transferring cards" pJ�103:T$=sy$+"No access to the printer driver while transferring cards" zH�104:T$=sy$+"You can't access files directly during a card transfer" �*�108:T$="This is a format, not a file" �J�109:T$=sy$+"You can't transfer cards into a format or undefined file" �B�110:T$=sy$+"You can't sort a file while you are creating it!" ���200:T$="Please open both source and target files before proceeding (by dragging to the correct place on the transfer window)" �2�201:T$="You already have a source file open!" �2�202:T$="You already have a target file open!" �=�203:T$=sy$+"You can't use formats in card transfer mode" �@�204:T$="Field expression, field: "+�fname(menufield%)+A$+�$ �&�205:T$="Invalid field references" �E�206:T$="No transfer defined - please select objects to transfer" �.�207:T$="Couldn't transfer workspace: "+�$ �#�208:T$=�$+" - transfer failed" �4�209:T$="Couldn't transfer numeric subsets: "+�$ )�210:T$="Couldn't transfer card: "+�$ 2�211:T$=sy$+"that's not a Transfer setup file" K�212:T$="Please open both source and target files before loading setup" $(�213:T$=�$+" - failed to load setup" .>�214:T$=sy$+"You can't copy the subsets without the cards" 8I�215:T$="Please close source/target files before cancelling transfer" B� L%�debug:T$+=" ("+Þ+") ["+�E%+"]" V �99,T$ ` j%��openfile(f$):�I%,T%:T%=opening% t0w_open%=�crwind(tw_open%):�unselall(w_open%) ~�seli(w_open%,1-7*(T%=1)) �.�T%=0�seli(w_open%,0):��shadei(w_open%,16) �!�I%=0�8:�shadei(w_open%,I%):� �6file$=f$:�seti(w_open%,13,f$):�seti(w_open%,14,"") �@$�ta(w_open%)="Open Source":�T%=1$�ta(w_open%)="Open Target" ��dialogue(w_open%):� � ���openfile1(f$,m%,d%,p$,r%) ��I%,g%,h%,X%,Y%,T$ �� ���:��:�loaderr:� �p$=�su(p$) ��w%(opening%,0)>0�err(3) Ah%=opening%:T$=f$:m%=�(99/(maxf%+1)+(99-(99/(maxf%+1)))*m%/7) -w%(h%,0)=�crwind(tw%(h%,0)):�makepane(h%) �p$=""p$=�pwcode(pass$) )pass$=�pwcode(p$):�clearpass%pass$="" (È™swi%,password_%,p$ 2%g%=0:È™swi%,open_%,T$,m%,d%,r%�G% <%g%=G%:�g%�?sd%<>13��warnfile:g%=� F$h%(h%)=�v_(2):�initfile:�default PÈ™swi%,selectkey_%,"?" ZÈ™swi%,sd45_%,"N" d)T$="Source=":�opening%=1:T$="Target=" n9�sdfile(h%):$�ta(w%(h%,0))=T$+�filename:�fext:�readws x�opening%=0�initpane �)X%=h%*80+panew%+8:Y%=900-h%*40-paneh% �>�open(w%(h%,0),X%,Y%,X%+paneh%,Y%+paneh%,0,0,-1):�validrec �șswi%,sd57_%,"bit7"�G% ��flg(f_7bit%,G%):fn$(h%)=f$ ��opening%=1� �)I%=4:�makeflist(h%):È™swi%,subset_%,0 �șswi%,order_%�N% �� �I%=2 �� �#�seti(w_transfer%,I%,�filename) �(�v_(1)<>4:�front(w_transfer%,-1,-1) ��g%�dialogue(w_mess%) � ��warnfile "*�T%,t%,I%,T$:w_mess%=�crwind(tw_mess%) ,�+1:�I%=0�7:�T$ 6)�g%�(2^I%):�seti(w_mess%,T%,T$):T%+=1 @�:�$sd%>""� JJ�seti(w_mess%,T%,"Password violations have occured as follows:"):T%+=1 Tt%=sd%:� ^>�t%<sd%+192:�$t%>"":�seti(w_mess%,T%," Using "+$t%):T%+=1 ht%+=64:�t%=sd%+192 r� |)È•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%)=0:s%(h%)=0:s$(h%)="":fc%(h%)=-1 �?a%(h%)=0:f$(h%)="":fx$(h%)="":e$(h%)="":ex$(h%)="":r%(h%)=1 �8o$(h%)="":o%(h%,0)=3:r$(h%)="":�I%=0�3:t%(h%,I%)=0:� �.l$(h%)="":lk$(h%)="":lx$(h%)="":sr$(h%)="" �%fn$(h%)="":p%(h%,0)=0:p$(h%,0)="" �6�I%=0�23:d$(h%,I%)="":�:�I%=0�18:�note(h%,I%,""):� �)�I%=0�29:�macln(h%,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 3fl%(h%)=f_dflt%:�tools%:fl%(h%)=fl%(h%)�f_pane% � & 0��loaderr:�I% :�normpoint:�h%>=0� D�g%:�delw(w_mess%) N�w%(h%,0)>0�delw(w%(h%,0)) X�w%(h%,1)>0�delw(w%(h%,1)) b�h%(h%)>0:�closefile(h%) l�=&80301� vDw_open%=�crwind(tw_open%):�unselall(w_open%):�seli(w_open%,m%+1) �8�d%�seli(w_open%,0):�opening%<>0:�shadei(w_open%,16) �!�I%=0�8:�shadei(w_open%,I%):� �6file$=f$:�seti(w_open%,13,f$):�seti(w_open%,14,"") �F$�ta(w_open%)="Open Source":�opening%=1$�ta(w_open%)="Open Target" �!�dialogue(w_open%):file%=-1:� �� �� �file%=-1:�err(6):� � ���closefile(h%):�I% ��sdfile(h%):�ready:�writews ��closeform:�delfilews(h%) �5h%(h%)=0:s%(h%)=0:f%(h%)=0:a%(h%)=0:w%(h%,0)=-1E9 )closeok%=�:file%=-1:È™swi%,close_%�S% �readtran:�transfer:� #��align(h%,I%):�tx1%-tx0%>108:� *��align1(h%,I%) 4.tx0%=h%*80+I%*40-40+panew%+8:tx1%=tx0%+440 >)ty1%=900-h%*40-I%*40+40:ty0%=ty1%-320 H� R \��makepane(h%) f)�P%:P%=�crwind(tw%(h%,1)):w%(h%,1)=P% pC�getw(P%):paneh%=y1%-y0%:panew%=x1%-x0%:�wext(P%,panew%,paneh%) z�h%=target%:�delw(w%(h%,1)) �� � ���makesubs(h%) ��P%,T$,I%,J%,K%,T% �:K%=w%(h%,2)>0:�K%�getw(w%(h%,2))��readblock(tw%(h%,2)) �4tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:�align(h%,2) �A�delfilew(h%,2):P%=�crwind(tw%(h%,2)):w%(h%,2)=P%:�sdfile(h%) �*$�ta(w%(h%,2))="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%) �seti(P%,I%+53,T$):�T$=""� �loseicon(P%,I%+53) $� ..�geti(P%,I%+53):�delicon(P%,I%+53):J%=I%+1 8:q%!4=!q%:q%!12+=T%:q%!20+=T%:È™"Wimp_CreateIcon",,q%+4 B� L �:�geti(P%,4):�delicon(P%,4) V: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%) jC�showsub1:�open(w%(h%,2),tx0%,ty1%-C%,tx1%+x1%-x0%,ty1%,0,0,-1) t� ~ ���makeflist(h%):�X%,Y%,T% �=�P%:P%=�makewind(h%,4):T%=�ta(P%):$T%="Fields="+�filename �*T%=�$T%+4:�formstat:È™swi%,sd64_%,1�G% ��G%<T%G%=T% �,X%=G%:�h%=target%:fwid%=X%*16+margin%+16 ��h%=target%X%=255 �=Y%=�v_(7):�wext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2) �� � ���makeilist(h%):�X%,Y%,T% �>�P%:P%=�makewind(h%,5):T%=�ta(P%):$T%="Indices="+�filename � T%=�$T%+4:È™swi%,sd64_%,2�G% �G%<T%G%=T% X%=G%:Y%=�nindices 5�wext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2):� (��makenotes(h%) 28�P%:P%=�makewind(h%,6):$�ta(P%)="Notepad="+�filename <� F P��makemacro(h%) Z6�P%:P%=�makewind(h%,7):$�ta(P%)="Macro="+�filename d� n xݤmakewind(h%,T%):�P%,I%,K% �=K%=w%(h%,T%)>0:�K%�getw(w%(h%,T%))��readblock(tw%(h%,T%)) �5tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:�align(h%,T%) �D�delfilew(h%,T%):P%=�crwind(tw%(h%,T%)):w%(h%,T%)=P%:�sdfile(h%) �,�open(P%,tx0%,ty0%,tx1%,ty1%,0,0,-1):=P% � �1ݤcrwind(T%):È™"Wimp_CreateWindow",,T%�T%:=T% � ���initpane �)�graph:�seti(w%(file%,1),7,s$(file%)) �7�showsub:�showindex:�showfilter:�showfound:�showmac �� � ���graph:�file%<>source%:� �P%,T%:T%=file%:P%=w%(T%,1) 1�geti(P%,12):È™"Wimp_DeleteIcon",,q%:q%!4=!q% 1q%!16=6+(326-6)*�v_(17)/(�v_(16)-(�v_(16)=0)) "È™"Wimp_CreateIcon",,q%+4 ,+È™"Wimp_ForceRedraw",P%,6,-216,326,-196 6�shownum:� @ J ��shownum T5�P%,T%,T$:T%=file%:�sdfile(T%):P%=w%(T%,1):�P%<0� ^N%=�v_(15):R%=�v_(17) h(�geti(P%,13):È™"Wimp_DeleteIcon",,q% r�badrec(N%)� |T$="??????????":q%!16=10 �� �,T$="C"+�"0000000000"+�N%,�(R%-(R%<1))+1) ��N%=0:T$="Default" �,q%!16=6+(326-6)*N%/(�v_(16)-(�v_(16)=0)) �� �Iq%!4=!q%:q%!8=q%!16-4:q%!12=-216:q%!20=-196:È™"Wimp_CreateIcon",,q%+4 �#�seti(P%,14,T$):�iconupd(P%,12) �� � �'��showsub:�P%:P%=w%(file%,1):�P%<0� �%�seti(P%,17,�subdesc):�showsub1:� � ���showsub1:�P% P%=w%(file%,2):�P%>0� '�subdisp1:�unselall(P%):�v_(11)=0� �seli(P%,1) &� 0�seli(P%,(�v_(11)�31)+28) :(�subset%>31:�seli(P%,(�v_(11)�31)+4) D� N� X� b l,��showindex:�P%,T%:P%=w%(file%,1):�P%<0� vÈ™swi%,istat_%,-1�G%,T% ��T%<=0$sd%=" * No Index *" ��seti(P%,16,$sd%):� � ���showfilter � �P%,T$:P%=w%(file%,1):�P%<0� �@�flg(f_filt%)T$=�trunc(f$(file%),19):�T$=" * No Filter *" ��seti(P%,21,T$) �� � � ��showmac � �P%,T$:P%=w%(file%,1):�P%<0� �*�macmode:�seli(P%,18):��unseli(P%,18) �� 1ݤtrunc(T$,T%):�T$<=T%:=T$:�=�T$,T%-3)+"..." )��showfound:�P%:P%=w%(file%,1):�P%<0� *#�seti(P%,23,""):�seti(P%,19,"") 4� > H2��delfilews(h%):�I%:�w%(h%,0)>0�delw(w%(h%,0)) R$�I%=1�maxw%:�delfilew(h%,I%):�:� \ f��delfilew(h%,I%) p@�w%(h%,I%)>0:�closew(w%(h%,I%)):�w%(h%,I%)>0�delw(w%(h%,I%)) z� � ���umess2 �Ȏq%!16� �$�6:�q%!8=loadref%:�datasaveack:� �� �� � ���backgrnd:�T% ��ackpending%:ackpending%=� ��sbfile%>=0:�subdisp �L%=lastact%:� �L%=(L%+1)�(maxf%+1) �)�L%=lastact%�(a%(L%)>0�L%<>stopfile%) (�a%(L%)=0�L%=stopfile%�dialogue%>0:� *lastact%=L%:�sdfile(L%):T%=�:ÈŽa%(L%)� �1:�copynext $� .(T%=(�-T%+4)�5:�T%<0T%=0:��T%>50T%=50 8.È™"OS_ReadMonotonicTime"�delay%:delay%+=T% B� L V/��template1(T$,q%):T$=�lower(T$):� I%,T%,L% `5I%=temp%+16:È•!I%>0��lower($(I%+12))<>T$:I%+=24:� j-�!I%<=0:�99,"Template '"+T$+"' not found" tCT%=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 �� � �q%!84>0� ��I%=q%+88�q%+84+q%!84*32�32 ��(I%!16)�(1<<8)� �3I%!20=�workspace(I%!28):$(I%!20)=$T%:T%+=�$T%+1 �=�I%!24>0:I%!24=�workspace(�$T%+1):$(I%!24)=$T%:T%+=�$T%+1 �� �� �� �q%!64=sprites% � $��opentemplate(A$):temp%=�-30000 �"Load "+A$+" "+�~temp%:� ( 2��template(T$) <�template1(T$,q%) F� P Zݤtemplate(T$) d�template1(T$,tbs%) nT%=tbs%:tbs%+=88+tbs%!84*32 x)�tbs%>tbe%:�99,"Template buffer full" �=T% � ���defws ��I% �bufsz%=&3000 �;� buffer% bufsz%:curbuf%=buffer%:endbuf%=buffer%+bufsz% � �opentemplate(�dir+"MSFrm5") �:�template("stopbox"):È™"Wimp_CreateWindow",,q%�w_stop% ��template("save") �-q%!64=1:È™"Wimp_CreateWindow",,q%�w_save% �<�template("ProgInfo"):È™"Wimp_CreateWindow",,q%�w_pinfo% �>�template("ProgInfo2"):È™"Wimp_CreateWindow",,q%�w_pinfo2% �;�template("shadow"):È™"Wimp_CreateWindow",,q%�w_shadow% bufsz%=&4500 6� template% bufsz%:tbs%=template%:tbe%=tbs%+bufsz% �I%=0�maxf% "tw%(I%,0)=�template("file") ,#tw%(I%,1)=�template("filepane") 6"tw%(I%,2)=�template("subsets") @$tw%(I%,3)=�template("FieldList") J$tw%(I%,4)=�template("FieldList") T$tw%(I%,5)=�template("FieldList") ^"tw%(I%,6)=�template("Notepad") h tw%(I%,7)=�template("Macro") r� | �opentemplate(�dir+"MSFrm6") �1tw_expr%=�template("expression"):w_expr%=-1E9 �.tw_nums%=�template("numeric"):w_nums%=-1E9 �+tw_open%=�template("open"):w_open%=-1E9 �1tw_status%=�template("Status"):w_status%=-1E9 �.tw_mess%=�template("message"):w_mess%=-1E9 �7tw_transfer%=�template("transfer"):w_transfer%=-1E9 �7tw_transexp%=�template("transexp"):w_transexp%=-1E9 �� � ���loadsprites �ssize%=16*1024 ��sprites% ssize% �2!sprites%=ssize%:È™"OS_SpriteOp",&109,sprites% .È™"OS_SpriteOp",&10A,sprites%,�dir+"MSSpr" � &��defmenus 0�t$ :� mlist% 32,function% 51 Dbufsz%=&900 NC� menufree% bufsz%:menuptr%=menufree%:menuend%=menufree%+bufsz% Xmenustart%=menufree%:�+2 b�t$:m_npad%=�crmenu(t$) l+�"#Notepad,Clear,Export>w_save%,Update" v�t$:m_main%=�crmenu(t$) �N�"#MultiStore,Info>w_pinfo%,Transfer,Fast Sort,Create,Status,Printer,Quit" ��t$:m_macro1%=�crmenu(t$) �'�"#Macro,Use#,Clear,Export>w_save%" ��t$:m_wind%=�crmenu(t$) �8�"#Window,Subset,Field,Index,Notepad,Macro#,Tidy Up" ��t$:m_card%=�crmenu(t$) �8�"#Card,Tools>w_pinfo%,Macro,Default,Window>m_wind%" ��t$:m_rtype%=�crmenu(t$) �5�"#Type,Cards,Sheet,Formula,Labels,Wordpro,Paged" ��t$:m_rset1%=�crmenu(t$) �%�"#Setup,Edit,Clear,Save}w_save%" ��t$:m_report%=�crmenu(t$) �@�"#Report,Type>m_rtype%,Setup>m_rset1%,Print,Export}w_save%" �t$:m_status%=�crmenu(t$) _�"#Statusmenu..,Align Windows,Read Workspace,Write Workspace,Update Media,Extended Charset" �t$:m_index%=�crmenu(t$) ,�"#Index,Ascending,Descending#,No Index" *�t$:m_transfer%=�crmenu(t$) 4N�"#Transfer,Swap Files,Open Target,Clear Setup,Default,Save Setup>w_save%" >� H R��front(h%,X%,Y%) \ �getw(h%) f�X%>=0x1%+=X%-x0%:x0%=X% p�Y%>=0y1%+=Y%-y0%:y0%=Y% z*�open(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1) �� � � ��top(h%) �6�getw(h%):�open(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1):� � �4��open(oh%,ox0%,oy0%,ox1%,oy1%,oscx%,oscy%,obh%) ��O%,f%:f%=file% �'!q%=oh%:È™"Wimp_GetWindowState",,q% ��wtof(oh%):�file%>=0� �Ȏwind%� �*�0:�file%<>target%�openpane:��wimpopen �:�wimpopen �� � ÈŽoh%� :�wimpopen $� .� 8e�oh%=dialogue%�shadows%:�getw(oh%):�open(w_shadow%,x0%+ss%,y0%-ss%,x1%+ss%,y1%-ss%,0,0,dialogue%) Bopen%=O%:�f%>=0:�sdfile(f%) L� V `��wimpopen j5!q%=oh%:q%!4=ox0%:q%!8=oy0%:q%!12=ox1%:q%!16=oy1% t>q%!20=oscx%:q%!24=oscy%:q%!28=obh%:È™"Wimp_OpenWindow",,q% ~� � ���openpane �笤flg(f_pane%):�wimpopen:� ��P%,f%:P%=w%(file%,1) �"f%=oy1%-paneh%:�f%<oy0%f%=oy0% � �getw(P%) �$�bhandle%=obh%�obh%=w%(file%,0)� �obh%=P% �:�open%�open(P%,ox0%-panew%-4,f%,ox0%-4,oy1%,0,0,obh%) �� �,�getw(P%):f%=oy1%-paneh%:�f%<oy0%f%=oy0% � �wimpopen -�getw(w%(file%,0)):�obh%=-2:obh%=bhandle% "f%=oy1%-paneh%:�f%<oy0%f%=oy0% 0�open(P%,x0%-panew%-4,f%,x0%-4,y1%,0,0,obh%) � ( 2��closew(!q%) <�I%,f%:f%=file% F�wtof(!q%) P�file%>=0� ZÈŽwind%� d,�0:�showbranch:�:��closeok%:�closeok:� n9�3:�file%=edfile%:�edrec%>=0:�endedit:!q%=w%(file%,3) x� �� ��!q%=dialogue%:�tidydial �ș"Wimp_CloseWindow",,q% �!�nodial:�wtof(!q%):�file%>=0� �Ȏwind%� ��0:�closefile(file%) �'�2,3,4,5,6,7:�delw(w%(file%,wind%)) �� �� � ÈŽ!q%� ��w_stop%:stopfile%=-1 ��w_expr%:�delw(w_expr%) ��w_open%:�delw(w_open%) �w_nums%:�delw(w_nums%) �w_status%:�delw(w_status%) �w_mess%:�delw(w_mess%) "#�w_transfer%:�delw(w_transfer%) ,#�w_transexp%:�delw(w_transexp%) 6� @� J� T ^��tidydial:�restorect hDdialreason%=-1:dialogue%=-1:�closew(w_shadow%):exi0%=-1:exi1%=-1 rdialfile%=-1:� | ���restorect ��:��:��:� �(È™ "Wimp_GetCaretPosition",,workbuf% �p�!workbuf%=dialogue%È™ "Wimp_SetCaretPosition",!dialct%,dialct%!4,dialct%!8,dialct%!12,dialct%!16,dialct%!20 �� � �;��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" � & 0<��geti(h%,i%):!q%=h%:q%!4=i%:È™"Wimp_GetIconState",,q%:� : D.ݤta(h%):!q%=h%:È™"Wimp_GetWindowInfo",,q% N,�(q%!60�&100)=0�1,"Title not indirected" X =q%!76 b l��stop(r%,T$,U$,T%) vdialreason%=r%:stopfile%=T% �#�-3��stopboxes%:mi%=3:�mstop:� �+�seti(w_stop%,0,T$):�seti(w_stop%,1,U$) �)�unselall(w_stop%):�dialogue(w_stop%) �dialreason%=r%:stopfile%=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 �dialogue%=h% !�front(h%,X%,Y%) !�setct(h%,-1,-1) !��@bC:� ! ;�readh(h%):�h%=dialogue%:�X%:�setct(h%,X%,�$�ia(h%,X%)) !*�h%<>-1:�:�X%:�X%<-1:h%=0 !4�h%=dialogue%�h%<0 !>� !H !R!��readpointer:�q%:q%=workbuf% !\È™"Wimp_GetPointerInfo",,q% !f1mx%=!q%:my%=q%!4:mb%=q%!8:mh%=q%!12:mi%=q%!16 !p� !z !�ݤdialogue:�file% !�6�dialogue%>=0�mh%<>dialogue%�mh%<>w_shadow%�nodial !�=� !� !�$��mouse(mx%,my%,mb%,mh%,mi%,mo%) !��dragreason%>=0�mb%>255:� !�7�wtof(mh%):�file%>=0�wind%=6�(mb%=1�mb%=4)�mi%<19:� !��mb%<16:�dialogue:� !�3w_info%=w_pinfo%:�mb%=7:mb%=2:w_info%=w_pinfo2% !�B�copying%>0:�mh%<>dialogue%�(mh%<>w_transfer%�mi%<>16)�buzz1:� !� ÈŽmb%� !��2:�menu !��1,4:�select "�16,64:�startdrag "� "� "$ ".6��seti(h%,i%,T$):T$=�T$,�il(h%,i%)):$�ia(h%,i%)=T$ "8<�iconupd(h%,i%):�getct:�!q%=h%�q%!4=i%:�setct(h%,i%,�T$) "B� "L "V'��iset(h%,i%,B%,E%):�q%:q%=workbuf% "`?!q%=h%:q%!4=i%:q%!12=B%:q%!8=E%:È™"Wimp_SetIconState",,q%:� "j "t'��iconupd(h%,i%):�iset(h%,i%,0,0):� "~ "���force(h%) "� ÈŽh%� "�.È™"Wimp_ForceRedraw",h%,-1E9,-1E9,1E9,1E9 "�� "�� "� "���readblock(p%) "�7x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12:� physical area "�Fscx%=p%!16:scy%=p%!20:bhandle%=p%!24:� scroll offsets, stack depth "�Jbx%=x0%-scx%:by%=y1%-scy%:� calculate physical co-ords of logical area "�>ex0%=p%!40:ey0%=p%!44:ex1%=p%!48:ey1%=p%!52:� logical area "�Agx0%=p%!24:gy0%=p%!28:gx1%=p%!32:gy1%=p%!36:� graphics window # .open%=(p%!28�&10000)<>0:� window open flag # � # #��getw(h%) #(%!q%=h%:È™"Wimp_GetWindowInfo",,q% #2�readblock(q%+4) #<� #F #P��select #Z�numi(mh%,mi%,mb%) #d�file%>=0� #nÈŽwind%� #x�0:�file%=target%� #� �ready #�� #� �1:�mpane #� �2:�msubs #��4:�mflist #��5:�milist #�� #�� #�3�mh%=dialogue%:�dialfile%>=0:�sdfile(dialfile%) #� ÈŽmh%� #�*�-2:�mb%=1��-1��-2:�oscli(""):��status #��w_open%:�mopen #��w_stop%:�mstop $�w_save%:�msave $�w_expr%:�mexpr $�w_status%:�mstatus $"$�w_mess%:�mi%=6:�closew(w_mess%) $,�w_transfer%:�mtransfer $6�w_transexp%:�mtransexp $@� $J� $T� $^ $h0��milist:�Y%:Y%=my%:�yconv(Y%,�nindices,mh%) $r�Y%>0:�selindex(Y%,0) $|� $� $�-��mflist:�Y%:Y%=my%:�yconv(Y%,�v_(7),mh%) $�;menufield%=Y%:expfield%=Y%:�mb%<>1�findfield:��fieldexp $�� $� $���mpane $� ÈŽmi%� $��0:�bof $��1:�back $� �2:�pause $��3:�fwd $��4:�eof $� �5:�ffind %�6:�nextmatch %�12:�gauge %�14:�cardnum %&*�18:�mb%=4�emacro:��s%(file%)=0:�macro %0 �17:�mb%=1:�selsub(0):��subs %:%�16:�mb%=1:�selindex(0,0):��index %D�21:�filter %N� %X� %b %l��filter %v$笤deadfile(%11111111111111110)� %��mb%=1:�nofilt:��expr(0) %�� %�� %� %���msubs %�#�deadfile(%11111111111111110)� %�%�T%:T%=�itos:�T%>=0:�selsub(T%):� %�� %� %���mstop %��mi%<3�mi%>4� %�5�T%,U%:U%=stopfile%:T%=dialreason%:dialreason%=-1 %��mi%=3� &'�closew(w_stop%):�U%>=0:�sdfile(U%) & ÈŽT%� &&�2:closeok%=�:�closew(w%(file%,0)) & �6:�CLOSE:�quit(�) &*�14:�loadnotes &4�17:�clearnpad &>�18:�clearmacro &H�19:�loadmacro &R�20:stopboxes%=� &\�22:�updcards &f�26:�asccard &p�27:È™swi%,setpass_%,"" &z�28:�loadsetup &�&�29:p$(file%,0)="":�makerep(file%) &�&�30:ll%(file%,0)=0:�makerep(file%) &�%�31:wo%(file%)=-1:�makerep(file%) &�.�32:È™swi%,sd21_%,tx0%,ty0%,menufield%,sd$ &��forcecard &��33:�r_clear:�forcerep &��34:�delcol(menucol%) &��35:�inscol(menucol%) &�+�36:�"*settype "+file$+" "+�~menufield% &��38:�picpath &��200:�endact &��201:�loadsetup &��202:�clear '�203:�default '� '� '$�T%=1:�CLOSE:�quit(�) '.� '8�closew(w_stop%):� 'B 'L��msave 'V�mi%<>0� '`0�T$:T$=$�ia(w_save%,2):�T$=�leaf(T$):�err(5) 'j1savetype%=savet%:task%=-1:file$=T$:�savedata1 't� '~ '���mnums:�mi%<>4�mi%<>5:� '��T%,B%,T$:�mi%=5� '�&B%=�$�ia(w_nums%,3):�B%=0:�err(14) '�%T%=0:È•2^T%<=B%:T%+=1:�:B%=2^T%-1 '�=T$=�up(�s($�ia(w_nums%,2))):�T$<2��T$>90��T$<65:�err(13) '�Ȏdialreason%� '��0 '�T%=�:� '���:T%=� '��T%:È™swi%,nameread_%,T$�G% '���:�T%:�err(15) '�#T%=0:ȕ�subname(T%)<>"":T%+=1:� ( "È™swi%,namewrite_%,T$,B%,-1�G% ( �1 (�submax(menusub%-256)<>B%� (,È™swi%,namewrite_%,T$,B%,menusub%-156�G% ((� (2!È™swi%,sd53_%,menusub%-256�G% (<,È™swi%,namewrite_%,T$,G%,menusub%-256�G% (F� (P� (Z�makesubs(file%):�showsub (d� (n�closew(w_nums%):� (x (�#��mopen:�mi%=11�closew(w_open%) (� �mi%<>12� (��I%,m%,d%,r%,p$ (�.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%) (�#�openfile1(file$,m%,d%,p$,r%):� (� (���mexpr (�0�A%,T$,c%,s%,u%,I%,Q%,B%:�unseli(w_expr%,29) (�<A%=�ia(w_expr%,17):�sdfile(dialfile%):�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_expr%,17,$A%+T$) )6 �10,11 )@N�(($A%>""�B%>0)�mi%=10)��Q%:$sd%=�"()",mi%-9,1):�seti(w_expr%,17,$A%+$sd%) )J �12,13 )TT$=$A%:�$A%>""��Q%� )^$sd%=�$A%):È™swi%,upper_% )h7�($sd%>="A"�$sd%<="Z")�($sd%>="0"�$sd%<="9")T$+=" " )r�mi%=12T$+="AND"�T$+="OR" )|� )��seti(w_expr%,17,T$) )�R�14:�$A%>""��Q%T$=$A%+"=""**""":�seti(w_expr%,17,T$):�setct(w_expr%,17,�$A%-2) )�Q�15:�$A%>""��Q%T$=$A%+"~=""""":�seti(w_expr%,17,T$):�setct(w_expr%,17,�$A%-1) )��20,21:�subs )��22:�nodial )��26:�nofilt:�nodial )�B�29:�$A%=""�seti(w_expr%,17,ex$):�ex$=$A%:�seti(w_expr%,17,"") )��23 )��wchi(w_expr%):I%=q%:� )� ÈŽ!I%� )��1:s%=� )��0:u%=� )��28:c%=� *� *I%+=4:�I%!-4=-1 *�conv($A%):�u%:�upplit($A%) *&�seti(w_expr%,17,$A%) *0ÈŽdialreason%� *:�0:�setfilt *D�1:�search *N �2:�rset2 *X� *b�nodial *l� *v�iconupd(w_expr%,17) *�� *� *� ��mstatus *� �T%,I%,A% *� ÈŽmi%� *��15,16,17,18,19,20,21,22 *�-T%=�statf:�T%>=0�front(w%(T%,0),-1,-1):�� *��12 *��13 *�sound%=�:shadows%=�:pix%=� *��wchi(w_status%):I%=q%:� *� ÈŽ!I%� *��24:sound%=� +�25:shadows%=� +�23:A%=� +�28:pix%=� + � +*I%+=4:�I%!-4<0 +41�sound%:È™swi%,opt_%,10�G%:�șswi%,opt_%,9�G% +>� +H�A%<>stopboxes%� +RF�A%stopboxes%=�:��stop(20,rl$+"disable these","stop boxes ?",-1):� +\� +f� +p� +z�closew(w_status%):� +� +���mtransfer +� ÈŽmi%� +��15:�dotransfer +�3�2:�w%(source%,0)>0:�front(w%(source%,0),-1,-1) +�3�4:�w%(target%,0)>0:�front(w%(target%,0),-1,-1) +��16:�endtransfer +�!�-1:�front(w_transfer%,-1,-1) +�� +�� +� +���mtransexp:�mi%<>3�mi%<>4� +�5�mi%=3:�T$:T$=�s($�ia(w_transexp%,1)):�setexp(T$) ,�closew(w_transexp%):� , ,��setexp(T$) ,$�T$=""� ,.&fd$(expfield%)="":fd%(expfield%)=0 ,8� ,B�sdfile(source%) ,L!t$=�x8(T$):fdx$(expfield%)=t$ ,V,�:��:��:menufield%=expfield%:�err(204) ,`È™swi%,sd59_%,T$�G% ,j�G%=-1:�err(205) ,t�� ,~ �G%<0� ,�fd%(expfield%)=G%�&FFFFFF ,�-fd$(expfield%)="@"+�fname(fd%(expfield%)) ,�� ,�'fd%(expfield%)=-1:fd$(expfield%)=T$ ,�� ,�� ,��updexp(expfield%) ,�� ,� ,���startdrag ,�/dragreason%=-1:dragbutton%=mb%:menufile%=-1 ,��wtof(mh%):�file%>=0� - menufile%=file% - ÈŽwind%� -�0 -1�file%=source%���deadfile(%1111111101011111)� -(<menufield%=�mousef:�menufield%>0dragreason%=3:�dragfield -2� -<�1 -F ÈŽmi%� -PF�14:笤deadfile(-1):menufield%=-1:dragreason%=3:�dragicon(mh%,mi%) -ZF�22:笤deadfile(%1111111101111111)dragreason%=1:�dragicon(mh%,mi%) -d� -n�2 -x`笤deadfile(%11111111111111110):menusub%=�itos:�menusub%>=0:dragreason%=2:�dragicon(mh%,mi%) -��4 -��file%=source%� -�:menufield%=my%:�formstat:�yconv(menufield%,�v_(7),mh%) -�dragreason%=3:�dragfield1 -�� -�>�6:�mi%<19:dragreason%=6:menufield%=mi%:�dragicon(mh%,mi%) -�� -�� -� ÈŽmh%� -�6�w_save%:�mi%=3:dragreason%=5:�dragicon(w_save%,3) -�� -�� -�� . . ��enddrag .1�readpointer:�menufile%>=0:�sdfile(menufile%) ." �mh%<>-1� .,ÈŽdragreason%� .6�1:�carddr .@�2:�subsdr .J�3:�fielddr .T�4:�carddr1 .^K�5:�savereq(�leaf($�ia(w_save%,2)),savet%,saves%,savereason%,savefile%) .h�6:�notedr .r� .|� .�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 /&)�wtof(mh%):menufile%=file%:�file%>=0� /0ÈŽwind%� /:�0,1:�cardmenu /D�5:�pop(m_index%,-1) /N�6:�pop(m_npad%,-1) /X�7:�pop(m_macro1%,-1) /b� /l� /v ÈŽmh%� /�1�-2:my%=64+7*44:menufile%=-1:�pop(m_main%,-1) /��w_status%:�statmenu /�%�w_transfer%:�pop(m_transfer%,-1) /�� /�� /�� /� /���cardmenu /�:笤flg(f_pane%)��deadfile1(%11111111101111110)�ready:� /�<�s%(file%)<>0��v_(15)<>0:�deadfile(%11111111101111110)� /��pop(m_card%,-1):� /� /�.��statmenu:menufile%=�statf:�menufile%<0:� 0�pop(m_status%,-1):� 0 0ݤpar(t$,s$,� i%):�i1% 0 i1%=i%+1:i%=�t$+s$,s$,i1%) 0*=�t$,i1%,i%-i1%) 04 0>ݤcrmenu(menu$) 0H.�menufree%+28>menuend%�99,"Menu area full" 0R� m% 0\menuptr%=menufree% 0fi%=0 0pC� �menu$,1)="#"i%=1:menutitle$=�par(menu$,",",i%)�menutitle$="" 0z$menuptr%=menutitle$ 0�;menuptr%?12=7:menuptr%?13=2:menuptr%?14=7:menuptr%?15=0 0�3menuptr%!16=196-24:menuptr%!20=44:menuptr%!24=0 0�"menuptr%+=28:maxx%=�menutitle$ 0��item$=�par(menu$,",",i%) 0��menuitem(item$) 0�� item$="" 0�$m%=menufree%:m%!16=(maxx%*8+6)*2 0�menufree%=menuptr% 0�=m% 0� 0���menuitem(text$) 0�.�text$=""menuptr%!-24=(menuptr%!-24)�&80:� 0�.�menuptr%+24>menuend%��99,"Menu area full" 1�i%,flg% 1flg%=&00 1i%=�text$,">") 1$<�i%>0subptr%=��text$,i%+1):text$=�text$,i%-1)�subptr%=-1 1.i%=�text$,"}") 18;�i%>0subptr%=��text$,i%+1):text$=�text$,i%-1):flg%+=&08 1B)��text$,1)="#"text$=�text$):flg%+=&02 1L;menuptr%!0=flg%:menuptr%!4=subptr%:menuptr%!8=&07000021 1V�text$,1)="$"� 1`2!menuptr%+=&04:menuptr%!8+=&100:i%=�text$,"(") 1j3�i%>0�L%=��text$,i%+1):text$=�text$,i%-1)�L%=12 1t8menuptr%!12=��text$,2):menuptr%!16=-1:menuptr%!20=L% 1~text$=�L%," ") 1�� 1��text$<=12� 1�$(menuptr%+12)=text$ 1�� 1�%I%=�workspace(�text$+1):$I%=text$ 1�6menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=�text$+1 1� menuptr%!8=menuptr%!8 � &100 1�� 1��text$>maxx%maxx%=�text$ 1�� 1�menuptr%+=24 1�� 2 2 ݤworkspace(L%) 22� curbuf%+L%>endbuf%�99,"No more buffer space" 2curbuf%+=L%:=curbuf%-L% 2( 22��prep(menu%,tree%) 2< �I%,T$ 2F4�clearts(menu%):�menufile%>=0:�sdfile(menufile%) 2PÈŽmenu%� 2Z�m_card%:�mp_card 2d�m_macro1%:�mp_macro1 2n�m_wind%:�mp_wind 2x�m_npad%:�mp_npad 2��m_main%:�mp_main 2��m_status%:�mp_status 2��m_report%:�mp_report 2��m_rtype%:�mp_rtype 2��m_rset1%:�mp_rset1 2��m_index%:�mp_index 2��m_transfer%:�mp_transfer 2�� 2�� 2� 2���mp_transfer 2�N�v_(1)<>4:�shade(menu%,0):�shade(menu%,2):�shade(menu%,3):�shade(menu%,4) 2�$�w%(target%,0)<=0�shade(menu%,1) 39�saveset(f_tf$,&D7B,200,-1,Ǝ�fd$()+maxfields%*2+200) 3� 3 3"��mp_index:�I% 3,3menuindex%=my%:�yconv(menuindex%,�nindices,mh%) 36,�nindices<=0:�I%=0�2:�shade(menu%,I%):� 3@� 3J 3T ��mp_card 3^�T%:T%=menu%+28+0*24+4 3h�menufile%=target%� 3r�shade(menu%,0) 3|� 3��shade(menu%,2) 3�:�flg(f_pane%):�tick(menu%,0):!T%=-1:�:!T%=w%(file%,1) 3�� 3��macmode:�tick(menu%,1) 3��defon:�tick(menu%,2) 3��prep(m_wind%,tree%):� 3� 3���mp_macro1 3�Ȏ�macmode � 3��f_macb%:�tick(menu%,0) 3��f_mace%:�tick(menu%,0) 3�� 3�*�saveset(f_mc$,&FFF,6,menufile%,80*30) 4� 4� 4 4&'��mp_file:�v_(1)<4:�shade(menu%,3) 40>�readonly:�shade(menu%,0):�shade(menu%,1):�shade(menu%,2) 4:� 4D 4N ��mp_wind 4X=�I%:�I%=0�maxw%-2:�w%(file%,I%+2)>0�tick(menu%,I%+(I%>0)) 4b5�menufile%=target%�shade(menu%,0):�shade(menu%,2) 4l�:� 4v 4� ��mp_status:$menu%=�filename 4�șswi%,sd57_%,"type"�G% 4�I�G%<>id_wcia%�G%<>id_bbc%�G%<>id_exb%:�shade(menu%,1):�shade(menu%,2) 4�șswi%,sd57_%,"bit7"�G% 4��G%=0�tick(menu%,4) 4�� 4� 4� ��mp_nums 4��nnums=10:�shade(menu%,0) 4�1�menusub%<255:�shade(menu%,2):�shade(menu%,1) 4�� 4� 4� ��mp_npad 5*�saveset(f_np$,&FFF,5,menufile%,80*19) 5� 5 5 ��mp_main 5* �w_transfer%>0�tick(menu%,1) 54G�v_(1)>0:�shade(menu%,3):�shade(menu%,5):�v_(1)>2:�shade(menu%,2) 5>� 5H 5R$��pop(menu%,tree%):�process%>0:� 5\�menu%<0:� 5f�prep(menu%,tree%) 5p,È™"Wimp_CreateMenu",,menu%,mx%-50,my%+32 5zopenmenu%=menu% 5�� 5� 5���nomenu 5�5È™"Wimp_CreateMenu",,-1:menufile%=-1:openmenu%=-1 5�� 5� 5�+��nodial:�dialogue%>0�closew(dialogue%) 5�� 5� 5���menuselect 5��I% 5�-I%=0:�mlist%!I%=q%!I%:I%+=4:�q%!(I%-4)=-1 5�1�readpointer:�menufile%>=0:�sdfile(menufile%) 6ÈŽopenmenu%� 6�m_main%:�m_main 6�m_card%:�m_card 6$�m_npad%:�m_npad 6.�m_macro1%:�m_macro1 68�m_status%:�m_status 6B�m_index%:�m_index 6L�m_transfer%:�m_transfer 6V� 6`�mb%=1� 6j$�menufile%>=0:�sdfile(menufile%) 6t#�pop(openmenu%,mlist%):��nomenu 6~� 6�� 6�� 6� 6� ��m_index 6�Ȏ!mlist%� 6�&�0,1:�selindex(menuindex%,!mlist%) 6��2:�selindex(0,0) 6�� 6�� 6� 6���m_main 6�Ȏ!mlist%� 7 �0:�dialogue(w_info%) 7 �1:�readtran:�transfer 7�2:�fastsort 7�3:�create 7(�4:�status 72�5:�pdriver 7<!�6:�v_(1)=0:�quit(�):��qquit 7F� 7P� 7Z 7d��m_transfer 7nÈŽ!mlist%� 7x�0:�swap 7��1:�targetopen 7�*�2:�stop(202,"",rl$+"clear setup?",-1) 7�+�3:�stop(203,"",rl$+"set defaults?",-1) 7�� 7�� 7� 7���m_card 7�Ȏ!mlist%� 7��0:�swpane 7��1:�swmacro 7��2:�swdefault 7��3:�m_wind 7�� 8� 8 8��m_macro1 8"ÈŽ!mlist%� 8,8�0:fl%(file%)=(fl%(file%)��f_macb%)�f_mace%:�showmac 86<�1:�stop(18,fi$+�filename,rl$+"clear macro ?",menufile%) 8@� 8J� 8T 8^��m_wind 8h�T%:T%=mlist%!4:T%-=T%>0 8rA�T%>-1�T%<maxw%-1:�w%(file%,T%+2)>0:�closew(w%(file%,T%+2)):� 8| ÈŽT%� 8��0:�subs 8��2:�fieldlist 8� �3:�index 8��4:�notepad 8� �5:�macro 8� �6:�wtidy 8�� 8�� 8� 8���m_status:�f%,T%:f%=� 8�Ȏ!mlist%� 8��0:�nodial:�walign 8��1:�readws:�newnotes 9�2:�writews 9�3:È™swi%,sd43_% 9 �4:�swap7 9& f%=� 90� 9:�f%:�nodial 9D� 9N 9X��m_format 9bÈŽmlist%!4� 9l�-1,0:�link 9v�1:�closeform 9�� 9�� 9� 9���m_npad 9�Ȏ!mlist%� 9�>�0:�stop(17,fi$+�filename,rl$+"clear notepad ?",menufile%) 9��2:�newnotes 9�� 9�� 9� 9���submenu(menu%,X%,Y%,q%) 9��I% 9�-I%=0:�mlist%!I%=q%!I%:I%+=4:�q%!(I%-4)=-1 :�prep(openmenu%,mlist%) :'È™"Wimp_CreateSubMenu",,menu%,X%,Y% :� : :* ��clearts(mh%):�I%:I%=mh%+28 :4"�mh%<menustart%�mh%>menuend%:� :>� :H"!I%=!I%��1:I%!8=I%!8��&400000: :RI%+=24:�I%!-24�&80 :\� :f :p��shade(mh%,I%) :z/mh%!(28+8+24*I%)=mh%!(28+8+24*I%)�&400000:� :� :���tick(mh%,I%) :�'mh%!(28+24*I%)=mh%!(28+24*I%)�&01:� :� :�ݤfiletype(T$) :�#�T%,U%:È™"OS_File",5,T$ �U%,,T% :� �T%=0:=-1 :�=(T%�&FFF00)>>8 :� :���redraw(update%) :��h%,T%:�update%� :�%È™"Wimp_UpdateWindow",,q% � more% :�� ;%È™"Wimp_RedrawWindow",,q% � more% ;� ;%h%=!q%:�wtof(h%):�readblock(q%+4) ;$È• more% ;.T%=�:�:��:T%=� ;8�T%� ;B"�-3:�rectfill(�$):���:�err(0) ;L� ;V�file%>=0� ;`ÈŽwind%� ;j�0:�drawcard ;t�4:�drawflist ;~�5:�drawilist ;�� ;�� ;�� ;�� ;��� ;�!q%=h%:more%=�nextrectangle ;�� ;�� ;� ;���drawcard ;�Ȏs%(file%)� ;��0 <