Home » Personal collection » Acorn hard disk » apps » MultiStore » !MultiStor/MultiStore
!MultiStor/MultiStore
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/MultiStore |
Read OK: | ✔ |
File size: | 29D71 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM> <MultiStore$Dir>.MultiStore 20REM By Merlyn Kline for Copyright (c) Minerva Software, 1989 30: version$="2.02" 40 50ONERROR:PROCerror(ERR,REPORT$+" - Failed to initialise",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%>0SYSswi%,selecttask_%,taskhandle%:IFi_v%SYS"Impulse_Decode",reason%,q%,,,,i_mth%,taskhandle%TOreason%,,,,,i_tok%,i_prm%,i_obj% 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 370WHEN&200,&201:PROCi_command(i_tok%,i_prm%,i_obj%) 380WHEN&202:PROCi_reply(i_tok%) 390WHEN&203:PROCi_senddata(i_tok%,i_prm%,i_obj%) 400WHEN&204:PROCi_receivedata(q%) 410ENDCASE 420PROCnormpoint 430ENDPROC 440 450DEFPROCquit(T%):PROCnormpoint 460IFNOT(INKEY-3ANDFNdebug):PROCi_close:$q%="TASK":SYS"Wimp_CloseDown",taskhandle%,!q% 470IFT%ORFNdebug:PROCtidy:END 480ONERROR:QUIT 490SYSswi%,killtask_%,taskhandle% 500QUIT 510 520DEFFNtask:IFVALFNArfVar("MultiStore$Function")<0:=0 530=otask% 540 550DEFPROCinit 560otask%=Z%:PROCswinums 570appl$="MultiStore":pstream%=0:PROCreleasepr 580LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 590DIM q% 2500, workbuf% 1500,dialct% 24 600RESTOREERROR 610waiter%=0:file%=-1:v%=FNinitwimp:IFv%<180:MODE12:PROCerr(2) 620PROCwaitpoint:LIBRARY(FNdir+"BaseLib") 630LIBRARY(FNdir+"SwiList"):PROCswilist 640quit%=FALSE:dialreason%=-1:dialogue%=-1:dialfile%=-1 650ackpending%=FALSE:ackref%=-1 660dragreason%=-1:help$="" 670savereason%=-1:savefile%=-1 680file2%=-1:reason2%=-1 690menufile%=-1:menusub%=-1 700closeok%=FALSE 710sbfile%=-1:pass$="" 720pdriver%=TRUE:SYS"OS_Byte",182,0,255 TO,pterm% 730IF(pterm%AND&80)=0SYS"OS_Byte",246,0,255TO,pterm% 740IFpterm%=10pterm%=1:ELSEpterm%=2 750LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 760DIMPDfname$(10),PDfont$(10),PDcpl%(10),PDfrom%(10),PDto$(10),PDclen%(10) 770id_wcia%=42:id_exb%=43:id_bbc%=0 780exi0%=-1:exi1%=-1:links%=0 790DIM edbuf% 256,edval% 15 800RESTOREERROR 810edfield%=-1:edfile%=-1:edicon%=-1:edrec%=-1:edx%=-1:$edval%="a0-9\-+." 820edrep%=FALSE:ss%=12:lc%=3:PROCreadparams:PROCwvars 830PROCloadsprites:PROCdefws:PROCdefmenus:PROCversion:PROCfilevars 840i_v%=0:PROCi_init 850process%=1:checkref%=-1:delay%=0 860stopfile%=-1:lastact%=0:chunk%=7 870as$="Are you sure ?":rl$="Really ":ri$=rl$+"interrupt ?":fi$="File: " 880lastspr$="":lix%=-1 890depth%=9:DIMlabel$(depth%) 900$t_impulse%="":i_merging%=0:i_file%=0 910LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 920DIMtone%(11,1):RESTORE+1:FORI%=0TO11:FORJ%=0TO1:READtone%(I%,J%):NEXT:NEXT 930RESTOREERROR 940PROCreadflags:PROCbaricon 950ENDPROC 960DATA24063,26145,22288,25564,22288,26145,22288,26726,22979,25564 970DATA22979,26145,22979,26726,23482,25564,23482,26145,23482,26726 980DATA24063,25564,24063,26726 990 1000DEFPROCswinums 1020ENDPROC 1030 1040DEFPROCwvars 1050REM ;{n 1060REM ;{n window handles in w%(maxf%,maxw%) - <=0 = Deleted 1070REM ;{n (,0)=Card (,1)=Pane (,2)=Subsets (,3)=Report 1080REM ;{n (,4)=Fields (,5)=Indices (,6)=Notepad (,7)=Macro 1090REM ;{n tw%(maxf%,maxw%) template pointers for windows 1100REM ;{n maxw% = max array index (windows) 1110REM ;{n maxf% = max array index (files) 1120REM ;{n 1130maxw%=7 1140DIMtw%(maxf%,maxw%),w%(maxf%,maxw%) 1150ENDPROC 1160 1170DEFPROCfilevars 1180REM ;{n h%(maxf%)=File handles 0 = not open 1190REM ;{n f%(maxf%)=Format handles 0 = not open, -ve = not linked 1200REM ;{n s%(maxf%)=status (0=card displayed) 1210REM ;{n (1=no cards in subset) 1220REM ;{n (2=background action) 1230REM ;{n s$(maxf%)=fast find string 1240REM ;{n+ d$(maxf%,23)=23 subset descriptions 1250REM ;{n+ f$(maxf%)=filter expressions 1260REM ;{n+ fx$(maxf%)=filters after expansion for abbreviations 1270REM ;{n+ e$(maxf%)=search expressions 1280REM ;{n ex$(maxf%)=search expressions after expansion 1290REM ;{n+ w$(maxf%,14)=wordpro o/p expressions 1300REM ;{n+ wo%(maxf%)=wordpro o/p type 1310REM ;{n fn$(maxf%)=file names 1320REM ;{n+ r%(maxf%)=report mode 1330REM ;{n 0 = Cards 1 = Sheet 2 = Formula 1340REM ;{n 3 = Labels 4 = Wordpro 5 = Paged 1350REM ;{n a%(maxf%)=background action in this file, -ve=linked to action 1360REM ;{n 0 = none 1370REM ;{n 1 = fast forward 1380REM ;{n 2 = fast back 1390REM ;{n 3 = searching 1400REM ;{n 4 = clearing/filling subset 1410REM ;{n 5 = copying subset 1420REM ;{n 6 = combining subsets 1430REM ;{n 7 = Deleting subset 1440REM ;{n 8 = updating cards 1450REM ;{n 9 = sorting cards 1460REM ;{n 10 = printing report 1470REM ;{n e%(maxf%,2)=background activity status stuff: 1480REM ;{n act e%(file%,0) e%(file%,1) e%(file%,2) 1490REM ;{n 3 source subset target subset recno 1500REM ;{n 4 target subset clear/fill flag recno 1510REM ;{n 5/6 source subset target subset recno 1520REM ;{n 7 target subset 1530REM ;{n 8 recno 1540REM ;{n 10 label line last label copy# recno 1550REM ;{n fc%(maxf%)=fast find, number found last search 1560REM ;{n fl%(maxf%)=boolean flags: 1570REM ;{n+ bit 0=filter on 1580REM ;{n bit 1=tool pane on 1590REM ;{n+ bit 2=macro browse mode on 1600REM ;{n+ bit 3=macro edit mode on 1610REM ;{n+ bit 4=filter space strip on 1620REM ;{n+ bit 5=filter uppercase on 1630REM ;{n+ bit 6=search space strip on 1640REM ;{n+ bit 7=search uppercase on 1650REM ;{n bit 8=search, add to subset 1660REM ;{n+ bit 9=report space strip on 1670REM ;{n+ bit10=report uppercase on 1680REM ;{n+ bit11=sheet report uppercase on 1690REM ;{n+ bit12=sheet report totals on 1700REM ;{n+ bit13=sheet report titles on 1710REM ;{n+ bit14=sheet report dashes on 1720REM ;{n+ bit15=wordpro output space stripped 1730REM ;{n+ bit16=wordpro output uppercase 1740REM ;{n+ bit17=wordpro output blank stripped 1750REM ;{n+ bit18=7-bit data in this file 1760REM ;{n+ bit19=paged report - eject before 1770REM ;{n+ bit20= " " - eject after 1780REM ;{n+ bit21= " " - double space 1790REM ;{n+ bit22= " " - top page nos 1800REM ;{n+ bit23= " " - bott. page nos 1810REM ;{n+ bit24= " " - print date 1820REM ;{n+ bit25= " " - totals: Page groups 1830REM ;{n+ bit26= " " - totals: Summary only 1840REM ;{n+ bit27= " " - link: duplicate 1850REM ;{n+ bit28= " " - link: summary 1860REM ;{n bit29=this file has a pic field 1870REM ;{n+ t%(maxf%,3)=global variables for macros 1880REM ;{n+ o$(maxf%)=sort expressions 1890REM ;{n ox$(maxf%)=sort expressions after expansion 1900REM ;{n+ o%(maxf%,6)=sort stuff (index 0,bit 0=ascend,bit 1=uppercase) 1910REM ;{n+ r$(maxf%)=report expressions, old style complex 1920REM ;{n rx$(maxf%)=report expressions after expansion 1930REM ;{n+ sr$(maxf%)=simple report field list 1940REM ;{n srx$(maxf%)=simple report field list after expansion 1950REM ;{n l%(maxf%)=link file+1 (0=none, -ve=unlinked) 1960REM ;{n+ l$(maxf%)=link expression for this file 1970REM ;{n+ lx$(maxf%)=expanded link expression. Also, link file name 1980REM ;{n+ lk$(maxf%)=link key 1990REM ;{n+ ll%(maxf%,7)=labels wid/mar/gap/dep/across/copies/lead/drop 2000REM ;{n+ lf%(maxf%,15)=label line flags for 16 lines: 2010REM ;{n bits 0..1 = L/C/R Justify 2020REM ;{n bits 2..3 = Font No. 2030REM ;{n bit 4 = Space Strip 2040REM ;{n bit 5 = Uppercase 2050REM ;{n bit 6 = fixed 2060REM ;{n l1%(maxf%,maxacr%-1)=line pointers for labels 2070REM ;{n+ p%(maxf%,4)=paged rep. pwid/marg/twid/tlen/plen 2080REM ;{n+ p$(maxf%,7)=paged rep. 4*header,subtot,subhead,ssubtot,ssubhead 2090REM ;{n+ c$(maxf%,maxcol%,1)=paged rep. col exprs, headers 2100REM ;{n+ c%(maxf%,maxcol%)=paged rep col formats: 2110REM ;{n bit 00-07 = Col width 2120REM ;{n bit 08-09 = Justification 0/1/2=Left/Centre/Right 2130REM ;{n bit 10-11 = Font number 2140REM ;{n bit 12 = Uppercase 2150REM ;{n bit 13 = Space strip 2160REM ;{n bit 14-16 = decimal places (7=string) 2170REM ;{n bit 17 = totals on 2180REM ;{n bit 18 = averages on 2190REM ;{n bit 19 = blank zeroes 2200REM ;{n bit 20 = insert commas 2210REM ;{n bit 21-23 = format (0-7) S/(-/b-/b+/-A/*/`/$ 2220REM ;{n ct(maxcol%,2)=paged rep col tots,subtots,subsubtots,summary 2230REM ;{n ct%(maxcol%,2)=paged rep col tots entry counts (for avg) 2240REM ;{n cv$(maxcol%,1)=paged rep column values, previous col vals 2250REM ;{n rl%(maxf%)=link map for paged report 2260REM ;{n rs%(maxf%*2)=link stack for paged report 2270REM ;{n m$(maxf%)=search mode flags 2280REM ;{n+ st%(maxf%,2)=file stats 2290REM ;{n 2300REM ;{n maxf% = max array index (files) 2310REM ;{n maxacr% = max labels across web 2320REM ;{n maxcol% = max array index (paged report columns) 2330REM ;{n 2340LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 2350DIM h%(maxf%),f%(maxf%),s%(maxf%),s$(maxf%),fc%(maxf%) 2360DIM fl%(maxf%),a%(maxf%),d$(maxf%,23),f$(maxf%),fx$(maxf%),t%(maxf%,3) 2370DIM e$(maxf%),ex$(maxf%),e%(maxf%,2),r%(maxf%),m$(maxf%),st%(maxf%,2) 2380DIM o$(maxf%),ox$(maxf%),o%(maxf%,6),r$(maxf%),rx$(maxf%),fn$(maxf%) 2390DIM l%(maxf%),l$(maxf%),lx$(maxf%),lk$(maxf%),rl%(maxf%),rs%(maxf%*2) 2400DIM sr$(maxf%),srx$(maxf%),ll%(maxf%,7),lf%(maxf%,15),l1%(maxf%,maxacr%-1) 2410DIM w$(maxf%,14),wo%(maxf%),p%(maxf%,4),p$(maxf%,7),c%(maxf%,maxcol%) 2420DIM c$(maxf%,maxcol%,1),ct(maxcol%,3),ct%(maxcol%,3),cv$(maxcol%,1) 2430RESTOREERROR 2440f_filt%=1<<00:f_pane%=1<<01:f_macb%=1<<02:f_mace%=1<<03 2450f_fspc%=1<<04:f_fupp%=1<<05:f_sspc%=1<<06:f_supp%=1<<07 2460f_sadd%=1<<08:f_rspc%=1<<09:f_rupp%=1<<10:f_srup%=1<<11 2470f_stot%=1<<12:f_stit%=1<<13:f_sdas%=1<<14:f_wspc%=1<<15 2480f_wupp%=1<<16:f_wbnk%=1<<17:f_7bit%=1<<18:f_rejb%=1<<19 2490f_reja%=1<<20:f_rdsp%=1<<21:f_rtpn%=1<<22:f_rbpn%=1<<23 2500f_rpdt%=1<<24:f_rtpg%=1<<25:f_rtsu%=1<<26:f_rldu%=1<<27 2510f_rlsu%=1<<28:f_pics%=1<<29 2520f_reps%=f_rldu%ORf_rlsu%ORf_rejb%ORf_reja%ORf_rdsp%ORf_rtpn%ORf_rbpn%ORf_rpdt%ORf_rtpg%ORf_rtsu% 2530f_save%=-1ANDNOT(f_pane%ORf_sadd%) 2540f_dflt%=f_fspc%ORf_fupp%ORf_sspc%ORf_supp%ORf_stot%ORf_stit%ORf_sdas%ORf_wspc% 2550ft_form%=&DE7:ft_data%=&DE8:maxw%=7 2560ENDPROC 2570 2580DEFPROCsdvars 2590SYSswi%,sd64_%,3TOlinegap% 2600margin%=8:IFFNv_(1)=1:PROCerr(3) 2610IFsound%:SYSswi%,opt_%,10:ELSESYSswi%,opt_%,9 2620date%=FNnyear(FNnow)*10000+FNnmon(FNnow)*100+FNnday(FNnow) 2630ENDPROC 2640 2650DEFPROCcheckprot:SYS"FlexiFile_Address"TOsd% 2660LOCALERROR:ONERRORLOCAL:process%=2:ENDPROC 2670SYSswi%,reset_%,taskhandle% 2680IFprocess%=3PROCstop(1,"OK. Please remove original &","replace backup if necessary",-1) 2690date$=FNstrdate1(FNnow,4):PROCsdvars:process%=4:ENDPROC 2700 2710DEFPROCversion 2720LOCALT$:T$=version$:IFNOTFNprod:T$+=" *UNFINISHED*" 2730PROCseti(w_pinfo%,4,"v"+T$):$FNtia(tw_status%,11)="v"+T$ 2740ENDPROC 2750 2760DEFFNprod=MID$(version$,INSTR(version$,".")+1,1)="0" 2770DEFFNdebug=NOTFNprod ANDINKEY-1ANDINKEY-2 2780 2790DEFFNinitwimp:first%=FALSE:taskhandle%=FNtask:IFtaskhandle%<>0:=200 2800$q%="TASK":SYS"Wimp_Initialise",200,!q%,"MultiStore"TO!q%,taskhandle% 2810first%=TRUE:=!q% 2820 2830DEFPROCtidy 2840LOCALERROR:PROCnormpoint 2850VDU4,26:PRINTTAB(0,3);:*fx4 2860*fx225,1 2870*fx229 2880Z%=0:SYSswi%,killtask_% 2890ONERRORLOCAL:ENDPROC 2900PRINT;menuend%-menufree%" bytes menu space" 2910PRINT;endbuf%-curbuf%" bytes indirection buffer space" 2920PRINT;tbe%-tbs%" bytes template buffer" 2930ENDPROC 2940 2950DEFPROCbaricon:IFNOTfirst%:ENDPROC 2960!q%=-1:q%!4=0:q%!8=0:q%!12=102:q%!16=68 2970q%!20=%11000000000010:$(q%+24)="!"+LEFT$(appl$,9) 2980SYS"Wimp_CreateIcon",,q%TObaricon% 2990ENDPROC 3000 3010DEFPROCstrip(RETURN T$) 3020$sd%=T$:SYSswi%,strip_% 3030T$=$sd% 3040ENDPROC 3050 3060DEFPROCerror(err%,err$,erl%,quit%) 3070IFFNdebug:VDU4,30:PRINTerr$" @ ";erl%:PROCquit(TRUE) 3080PROCnormpoint:dragreason%=-1:@%=&90A:*fx229,1 3090LOCALi%,e%,t$,T$ 3100IFNOTFNprod:err$+=" ("+STR$ERL+")" 3110LOCALERROR 3120ONERRORLOCAL:PROCerror(ERR,REPORT$,ERL,TRUE) 3130!q%=err%:$(q%+4)=err$:SYS"Wimp_ReportError",q%,1,appl$:line$="" 3140IFquit%:PROCquit(FALSE) 3150ENDPROC 3160 3170DEFPROCreport:IFFNdebug:VDU4:REPORT:PRINT" @ ";ERL:PROCquit(TRUE) 3180ENDPROC 3190 3200DEFFNdir 3210LOCALT$:T$=FNArfVar(appl$+"$Dir") 3220IFT$="":T$="&.!"+LEFT$(appl$,9)+"." 3230IFRIGHT$(T$)<>".":T$+="." 3240=T$ 3250 3260DEFFNArfVar(A$):LOCALL%,V% 3270SYS"XOS_ReadVarVal",A$,workbuf%,254,0,3TO,,L%;V%:IFV%AND1:L%=0 3280workbuf%?L%=13:=$workbuf% 3290 3300DEFPROCumess1 3310ref%=q%!8:task%=q%!4:IFtask%=taskhandle%:ENDPROC 3320mess%=q%!16 3330CASEmess%OF 3340WHEN0:PROCCLOSE:PROCquit(FALSE) 3350WHEN1:PROCdatasaved 3360WHEN2:PROCsavedata 3370WHEN3:PROCdataload 3380WHEN4:ackpending%=FALSE 3390WHEN5:PROCdataopen 3400WHEN6: 3410WHEN7: 3420WHEN8:PROCprequit 3430WHEN9: 3440WHEN10:PROCwritecomm(q%!20) 3450WHEN&502: 3460WHEN&400C0:PROCsubmenu(q%!20,q%!24,q%!28,q%+32) 3470WHEN&80300:PROCackrec 3480ENDCASE 3490ENDPROC 3500 3510DEFPROCdataopen 3520IFq%!40=ft_form%:PROCdataloadack:PROCerr(1) 3530IFq%!40<>ft_data%:ENDPROC 3540PROCdataloadack:mh%=-1 3550IFprocess%=0:IFNOTFNdialogue:PROCopenfile1(FNzts(q%+44),0,0,"",readonly%) 3560ENDPROC 3570 3580DEFPROCdataload 3590LOCALT%:del%=q%!12<>0 3600PROCreadpointer:PROCwtof(mh%) 3610CASE TRUE OF 3620WHEN q%!40=&FF9 ANDwind%=0:PROCdataloadack:PROCloadspr(FNzts(q%+44)) 3630WHEN q%!40=&1000:file$=FNzts(q%+44):PROCstop(38,RIGHT$(file$,29),rl$+"set picture path ?",-1) 3640WHEN q%!40=&2000:file$=FNzts(q%+44) 3650IFASCFNleaf(file$)=33THEN 3660T%=OPENIN(file$+".!DocData"):IFT%:CLOSE#T% 3670IFT%ANDi_merging%=0:i_doc$=MID$(FNleaf(file$),2):IFfile%>=0:PROCi_impulse 3680PROCi_seticons 3690ENDIF 3700WHEN q%!40=ft_data%ANDmh%=-2 3710PROCdataloadack:IFprocess%=0:IFNOTFNdialogue:PROCopenfile(FNzts(q%+44)) 3720WHEN q%!40=&FFD ANDmh%=-2 3730IFprocess%=0:IFNOTFNdialogue:PROCcheckconv(FNzts(q%+44)) 3740WHEN q%!40=ft_form%ANDmh%=-2:PROCdataloadack:PROCerr(1) 3750WHEN q%!40=ft_form%ANDfile%>=0ANDwind%<2:PROCdataloadack:PROCopenform 3760WHEN q%!40=&FFF ANDfile%>=0ANDwind%=6:PROCdataloadack:file$=FNzts(q%+44):PROCstop(14,fi$+FNfilename,rl$+"load notes ?",file%) 3770WHEN file%>=0ANDwind%=1ANDmi%=17:PROCdataloadack:file$=FNzts(q%+44):PROCstop(37,fi$+FNfilename,rl$+"import ASCII file ?",file%) 3780WHEN q%!40=&FFF ANDfile%>=0ANDwind%=7:PROCdataloadack:file$=FNzts(q%+44):PROCstop(19,fi$+FNfilename,rl$+"load macro ?",file%) 3790WHEN q%!40=&FFF ANDfile%=edfile%ANDfile%>=0ANDwind%=-3*edrep%ANDedicon%>=0:PROCdataloadack:PROCloadfield(FNzts(q%+44)) 3800WHEN q%!40=&FFF ANDfile%>=0ANDwind%=0:PROCdataloadack:file$=FNzts(q%+44):PROCstop(26,fi$+FNfilename,rl$+"load ASCII card ?",file%) 3810WHEN mh%=w_pdrive%:PROCdataloadack:file$=FNzts(q%+44):PROCPDload 3820WHEN q%!40=&D7B:PROCchecksetup 3830ENDCASE 3840ENDPROC 3850 3860DEFPROCloadfield(file$) 3870LOCALT$,T% 3880LOCALERROR:ONERRORLOCAL:ENDPROC 3890T%=OPENINfile$:IFT%=0:ENDPROC 3900WHILET$=""ANDNOTEOF#T%:T$=GET$#T%:ENDWHILE 3910CLOSE#T%:PROCnoscrap 3920PROCseti(w%(edfile%,-3*edrep%),edicon%,T$) 3930ENDPROC 3940 3950DEFPROCnoscrap 3960IFdel%:*Remove <Wimp$Scrap> 3970ENDPROC 3980 3990DEFPROCdatasaved 4000PROCreadpointer:PROCwtof(mh%) 4010CASE TRUE OF 4020WHEN q%!40=&FFF ANDfile%>=0AND(wind%=6ORwind%=7ORwind%=0):PROCdatasaveack 4030WHEN q%!40=&2000:file$=FNzts(q%+44) 4040IFASCFNleaf(file$)=33ANDi_merging%=0THEN 4050i_doc$=MID$(FNleaf(file$),2) 4060IFfile%>=0:PROCi_impulse:ELSEIFmh%=w_impulse%:PROCi_seticons 4070ENDIF 4080ENDCASE 4090ENDPROC 4100 4110DEFPROCerr(E%) 4120LOCALT$,A$:IFfile%>=0A$=", "+fi$+FNfilename+" - ":ELSEA$=" - " 4130@%=&90A:*fx229,1 4140CASEE%OF 4150WHEN0:T$=REPORT$ 4160WHEN1:T$="To use a format, drag it onto a card" 4170WHEN2:T$="Must be version 1.8 WIMP or later" 4180WHEN3:T$="Sorry! Too many files already open" 4190WHEN4:T$="Sorry! You can only run one RAMManager task at a time" 4200WHEN5:T$="To save, drag the icon to a directory viewer or another task" 4210WHEN6:T$="Couldn't open file: "+REPORT$:IFREPORT$="Data lost":T$+=" (Ensure the disc is not write protected)" 4220WHEN7:T$="Couldn't open format: "+REPORT$ 4230WHEN8:T$="Filter expression"+A$+REPORT$ 4240WHEN9:T$="Search expression"+A$+REPORT$ 4250WHEN10:T$="Unbalanced quote marks ("")" 4260WHEN11:T$="Unbalanced brackets" 4270WHEN12:T$="No cards to search in this subset" 4280WHEN13:T$="The name should be 2-4 characters and start with a letter" 4290WHEN14:T$="Please specify the maximum value to store in the subset" 4300WHEN15:T$="Subset already exists" 4310WHEN16:T$="Field names must start with a letter" 4320WHEN17:T$="Copying/combining subsets"+A$+REPORT$ 4330WHEN18:T$="English query"+A$+REPORT$ 4340WHEN19:T$="Can't understand meaning" 4350WHEN20:T$="Macro line "+STR$(er%+1)+A$+REPORT$ 4360WHEN21:T$="Missing THEN or GO clause in IF statement" 4370WHEN22:T$="Invalid macro line number for GO" 4380WHEN23:T$="Illegal variable assignment" 4390WHEN24:T$="Field assignment expected" 4400WHEN25:T$="Field name not specified" 4410WHEN26:T$="Subset value assignment expected" 4420WHEN27:T$="Subset name/letter not specified" 4430WHEN28:T$="Invalid subset name/letter" 4440WHEN29:T$="Illegal notepad reference identifier" 4450WHEN30:T$="Abbreviated expression too complex to expand" 4460WHEN31:T$="Illegal pattern matching" 4470WHEN32:T$="Validating card"+A$+REPORT$+" (Filter/Subset disabled)" 4480WHEN33:T$="Illegal global variable number" 4490WHEN34:T$="Sort expression"+A$+REPORT$ 4500WHEN35:T$="Expression should not be blank" 4510WHEN36:T$="Fast find"+A$+"couldn't find matching card" 4520WHEN37:T$="Link expression"+A$+REPORT$ 4530WHEN38:T$="Link file not open" 4540WHEN39:T$="You can't link to an active file" 4550WHEN40:T$="You can't have a circular link setup" 4560WHEN41:T$="Printer already in use" 4570WHEN42:T$="Printer in use by file "+FNofilename(printer%) 4580WHEN43:T$="Printing"+A$+REPORT$+" (Report terminated)" 4590WHEN44:T$="Simple report definition"+A$+REPORT$ 4600WHEN45:T$="Report formula"+A$+REPORT$ 4610WHEN46:T$="Exporting report"+A$+REPORT$+" (export cancelled)" 4620WHEN47:T$="The two new passwords must be identical. Please re-enter" 4630WHEN48:T$="Not a suitable printer driver" 4640WHEN49:T$="You can't load that setup file there" 4650WHEN50:T$="Can't recognise format of setup file" 4660WHEN51:T$="You must specify the current password correctly" 4670WHEN52:T$="Column "+STR$(column%+1)+" formula"+A$+REPORT$ 4680WHEN53:T$="No room to add another column!" 4690WHEN54:T$="Plotting picture"+A$+REPORT$+" (release ALT to redraw)" 4700WHEN55:T$="Sorry! You can only generate one paged report at a time" 4710WHEN56:T$="Report interrupted" 4720WHEN57:T$="Sub-total formula"+A$+REPORT$ 4730WHEN58:T$="Sub-sub-total formula"+A$+REPORT$ 4740WHEN59:T$="Program not found" 4750WHEN60:T$=REPORT$+" - Can't load file creation software" 4760WHEN61:T$="Sorry! Not enough subsets available for a search" 4770WHEN62:T$=REPORT$+" - Can't load file transfer software" 4780WHEN63:T$="That's a Transfer setup file - you can't load it here!" 4790WHEN64:T$="Please drag sprites to a picture field" 4800WHEN65:T$=REPORT$+" - ASCII import failed" 4810WHEN66:T$="** WARNING ** This is an evaluation copy of MultiStore. Many features are restricted and it may time-out without warning. You are advised to close any other important tasks now." 4820WHEN67:T$=REPORT$+" - Check memory allocation" 4830WHEN68:T$=REPORT$+" - Unable to load sprite file" 4840WHEN69:T$=REPORT$+" - Unable to load window template file" 4850WHEN70:T$="Recieved Impulse request to send unknown data" 4860WHEN71:T$="Please specify a target document" 4870WHEN72:T$="Sorry! That field is not on the linked format" 4880WHEN73:T$="Sorry! You can't edit a report when a format is linked" 4890ENDCASE 4900IFNOTFNprod:T$+=" ("+STR$ERL+") ["+STR$E%+"]" 4910ERROR99,T$ 4920 4930DEFPROCopenfile(f$) 4940w_open%=FNcrwind(tw_open%):PROCunselall(w_open%):PROCseli(w_open%,1) 4950file$=f$:PROCseti(w_open%,13,f$):PROCseti(w_open%,14,"") 4960PROCdialogue(w_open%):ENDPROC 4970 4980DEFPROCopenfile1(f$,m%,d%,p$,r%) 4990LOCALI%,g%,h%,X%,Y%,T$:p$=FNsu(p$) 5000LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCloaderr:ENDPROC 5010h%=-1:IFFNv_(1)/2<=maxf%THEN 5020I%=0:WHILE I%<=maxf% 5030IFh%(I%)<=0:h%=I%:I%=maxf%+1 5040I%+=1:ENDWHILE 5050ENDIF 5060T$=f$:m%=INT(99/(maxf%+1)+(99-(99/(maxf%+1)))*m%/7) 5070IFh%<0:PROCerr(3) 5080w%(h%,0)=FNcrwind(tw%(h%,0)):PROCmakepane(h%) 5090IFp$=""p$=FNpwcode(pass$) 5100pass$=FNpwcode(p$):IFclearpass%pass$="" 5110SYSswi%,password_%,p$ 5120g%=0:SYSswi%,open_%,T$,m%,d%,r%TOG% 5130g%=G%:IFg%OR?sd%<>13THENPROCwarnfile:g%=TRUE 5140IFfillcache%:*FFCacheFill 5150h%(h%)=FNv_(2):PROCinitfile 5160SYSswi%,selectkey_%,"?" 5170SYSswi%,sd45_%,"N" 5180PROCsdfile(h%):$FNta(w%(h%,0))="File="+FNfilename:PROCfext:PROCreadws 5190PROCinitpane:X%=h%*80+panew%+8:Y%=900-h%*40-paneh% 5200PROCopen(w%(h%,0),X%,Y%,X%+paneh%,Y%+paneh%,0,0,-1):PROCvalidrec 5210SYSswi%,sd57_%,"bit7"TOG% 5220PROCflg(f_7bit%,G%):PROCclrmv:PROCflg(f_pics%,FNisfield("PIC")) 5230fn$(h%)=f$:IFg%PROCdialogue(w_mess%) 5240ENDPROC 5250 5260DEFPROCwarnfile 5270LOCALT%,t%,I%,T$:w_mess%=FNcrwind(tw_mess%) 5280RESTORE+1:FORI%=0TO7:READT$ 5290IFg%AND(2^I%):PROCseti(w_mess%,T%,T$):T%+=1 5300NEXT:IF$sd%>""THEN 5310PROCseti(w_mess%,T%,"Password violations have occured as follows:"):T%+=1 5320t%=sd%:REPEAT 5330IFt%<sd%+192:IF$t%>"":PROCseti(w_mess%,T%," Using "+$t%):T%+=1 5340t%+=64:UNTILt%=sd%+192 5350ENDIF 5360WHILET%<6:PROCseti(w_mess%,T%,""):T%+=1:ENDWHILE:ENDPROC 5370DATA"** This file MAY be CORRUPTED due to illegal closure **" 5380DATA" ** This file has been accessed by older software **" 5390DATA,,,, 5400 5410DEFPROCinitfile 5420f%(h%)=0:s%(h%)=0:s$(h%)="":fc%(h%)=-1 5430a%(h%)=0:f$(h%)="":fx$(h%)="":e$(h%)="":ex$(h%)="":r%(h%)=1 5440o$(h%)="":o%(h%,0)=3:r$(h%)="":rx$(h%)="":FORI%=0TO3:t%(h%,I%)=0:NEXT 5450l%(h%)=0:l$(h%)="":lk$(h%)="":lx$(h%)="":sr$(h%)="":srx$(h%)="" 5460fn$(h%)="":p%(h%,0)=0:p$(h%,0)="":m$(h%)="" 5470FORI%=0TO23:d$(h%,I%)="":NEXT:FORI%=0TO18:PROCnote(h%,I%,""):NEXT 5480FORI%=0TO29:PROCmacln(h%,I%,""):NEXT:wo%(h%)=0 5490FORI%=0TO15:lf%(h%,I%)=0:NEXT:FORI%=0TO14:w$(h%,I%)="":NEXT 5500ll%(h%,0)=30:ll%(h%,1)=4:ll%(h%,2)=4:ll%(h%,3)=9:ll%(h%,4)=2:ll%(h%,5)=1 5510ll%(h%,6)=lab_lead%:ll%(h%,7)=lab_drop% 5520fl%(h%)=f_dflt%:IFtools%:fl%(h%)=fl%(h%)ORf_pane% 5530ENDPROC 5540 5550DEFPROCloaderr 5560PROCnormpoint:IFh%>=0THEN 5570IFg%:PROCdelw(w_mess%) 5580IFw%(h%,0)>0PROCdelw(w%(h%,0)) 5590IFw%(h%,1)>0PROCdelw(w%(h%,1)) 5600IFh%(h%)>0:PROCclosefile(h%) 5610IFERR=&80301THEN 5620w_open%=FNcrwind(tw_open%):PROCunselall(w_open%):PROCseli(w_open%,m%+1) 5630IFd%PROCseli(w_open%,0) 5640file$=f$:PROCseti(w_open%,13,f$):PROCseti(w_open%,14,"") 5650PROCdialogue(w_open%):file%=-1 5660IFp$="MINERVACODE":ERROR99,"Pass code is '"+FNp_passcode(file$)+"'" 5670ENDPROC 5680ENDIF 5690ENDIF 5700file%=-1:PROCerr(6):ENDPROC 5710 5720DEFPROCclosefile(h%):LOCALI% 5730PROCi_kill(h%) 5740FORI%=0TOmaxf%:IFl%(I%)=h%+1:PROCsdfile(I%):PROCunlink 5750NEXT:PROCsdfile(h%):PROCready:IFl%(h%)>0:PROCunlink 5760PROCcloseform:PROCcf_writews:PROCdelfilews(h%) 5770h%(h%)=0:s%(h%)=0:f%(h%)=0:a%(h%)=0:w%(h%,0)=-1E9:l%(h%)=0 5780closeok%=FALSE 5790SYS&20000+swi%,close_%TOS% 5800ENDPROC 5810 5820DEFPROCcf_writews:LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 5830PROCwritews:ENDPROC 5840 5850DEFPROCalign(h%,I%):IFtx1%-tx0%>108:ENDPROC 5860DEFPROCalign1(h%,I%) 5870tx0%=h%*80+I%*40-40+panew%+8:tx1%=tx0%+440 5880ty1%=900-h%*40-I%*40+40:ty0%=ty1%-320 5890ENDPROC 5900 5910DEFPROCmakepane(h%) 5920LOCALP%:P%=FNcrwind(tw%(h%,1)):w%(h%,1)=P% 5930PROCgetw(P%):paneh%=y1%-y0%:panew%=x1%-x0%:PROCwext(P%,panew%,paneh%) 5940ENDPROC 5950 5960DEFPROCmakesubs(h%) 5970LOCALP%,T$,I%,J%,K%,T% 5980K%=w%(h%,2)>0:IFK%PROCgetw(w%(h%,2))ELSEPROCreadblock(tw%(h%,2)) 5990tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:PROCalign(h%,2) 6000PROCdelfilew(h%,2):P%=FNcrwind(tw%(h%,2)):w%(h%,2)=P%:PROCsdfile(h%) 6010$FNta(w%(h%,2))="Subsets of "+FNfilename 6020T$=FNsubstr:FORI%=0TO23 6030IFMID$(T$,I%+1,1)<>".":PROCloseicon(P%,I%+5):PROCloseicon(P%,I%+29) 6040NEXT 6050WHILET$>""ANDRIGHT$(T$)<>".":T$=LEFT$(T$):ENDWHILE:T$=LEFT$(T$,24) 6060C%=((LENT$-1)DIV6+1)*56+62:IFK%:C%=ty1%-ty0% 6070T%=(3-(LENT$-1)DIV6)*56:J%=0:FORI%=0TO9:T$=FNsubname(I%) 6080PROCseti(P%,I%+53,T$):IFT$=""THEN 6090PROCloseicon(P%,I%+53) 6100ELSE 6110PROCgeti(P%,I%+53):PROCdelicon(P%,I%+53):J%=I%+1 6120q%!4=!q%:q%!12+=T%:q%!20+=T%:SYS"Wimp_CreateIcon",,q%+4 6130ENDIF 6140NEXT:PROCgeti(P%,4):PROCdelicon(P%,4) 6150q%!4=!q%:q%!12+=T%:q%!20+=T%:SYS"Wimp_CreateIcon",,q%+4 6160T%+=((10-J%)DIV5)*64:PROCgetw(P%):PROCwext(P%,ex1%,-ey0%-T%) 6170PROCshowsub1:PROCopen(w%(h%,2),tx0%,ty1%-C%,tx1%+x1%-x0%,ty1%,0,0,-1) 6180ENDPROC 6190 6200DEFPROCmakerep(h%) 6210LOCALP%,X%,Y%:P%=FNmakewind(h%,3):$FNta(P%)="Report="+FNfilename 6220PROCsdfile(h%):PROCrepdefault:PROCrext:PROCmatchrep:ENDPROC 6230 6240DEFPROCmakeflist(h%):LOCALT% 6250LOCALP%:P%=FNmakewind(h%,4):T%=FNta(P%):$T%="Fields="+FNfilename 6260T%=LEN$T%+4:PROCformstat:SYSswi%,sd64_%,1TOG% 6270IFG%<T%G%=T% 6280PROCwext(P%,G%*16+margin%*2,FNv_(7)*linegap%+margin%*2):ENDPROC 6290 6300DEFPROCmakeilist(h%):LOCALX%,Y%,T% 6310LOCALP%:P%=FNmakewind(h%,5):T%=FNta(P%):$T%="Indices="+FNfilename 6320T%=LEN$T%+4:SYSswi%,sd64_%,2TOG% 6330IFG%<T%G%=T% 6340X%=G%:Y%=FNnindices 6350PROCwext(P%,X%*16+margin%*2,Y%*linegap%+margin%*2):ENDPROC 6360 6370DEFPROCmakenotes(h%) 6380LOCALP%:P%=FNmakewind(h%,6):$FNta(P%)="Notepad="+FNfilename 6390ENDPROC 6400 6410DEFPROCmakemacro(h%) 6420LOCALP%:P%=FNmakewind(h%,7):$FNta(P%)="Macro="+FNfilename 6430ENDPROC 6440 6450DEFFNmakewind(h%,T%):LOCALP%,I%,K% 6460K%=w%(h%,T%)>0:IFK%PROCgetw(w%(h%,T%))ELSEPROCreadblock(tw%(h%,T%)) 6470tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:PROCalign(h%,T%) 6480PROCdelfilew(h%,T%):P%=FNcrwind(tw%(h%,T%)):w%(h%,T%)=P%:PROCsdfile(h%) 6490PROCopen(P%,tx0%,ty0%,tx1%,ty1%,0,0,-1):=P% 6500 6510DEFFNcrwind(T%):SYS"Wimp_CreateWindow",,T%TOT%:=T% 6520 6530DEFPROCinitpane 6540PROCgraph:PROCseti(w%(file%,1),7,s$(file%)) 6550PROCshowsub:PROCshowindex:PROCshowfilter:PROCshowfound:PROCshowmac 6560ENDPROC 6570 6580DEFPROCgraph 6590LOCALP%,T%:T%=file%:P%=w%(T%,1) 6600PROCgeti(P%,12):SYS"Wimp_DeleteIcon",,q%:q%!4=!q% 6610q%!16=6+(326-6)*FNv_(17)/(FNv_(16)-(FNv_(16)=0)) 6620SYS"Wimp_CreateIcon",,q%+4 6630SYS"Wimp_ForceRedraw",P%,6,-216,326,-196 6640PROCshownum:ENDPROC 6650 6660DEFPROCshownum 6670LOCALP%,T%,M%,T$:T%=file%:PROCsdfile(T%):P%=w%(T%,1) 6680N%=FNv_(15):R%=FNv_(17):M%=FNv_(16) 6690PROCgeti(P%,13):SYS"Wimp_DeleteIcon",,q% 6700IFFNbadrec(N%)THEN 6710T$="??????????":q%!16=10 6720ELSE 6730T$="C"+RIGHT$("0000000000"+STR$N%,LOG(R%-(R%<1))+1.000000001) 6740IFN%=0:T$="Default" 6750IFs%(file%)=1:T$="" 6760q%!16=6+(326-6)*N%/(M%-(M%=0)) 6770ENDIF 6780q%!4=!q%:q%!8=q%!16-4:q%!12=-216:q%!20=-196:SYS"Wimp_CreateIcon",,q%+4 6790PROCseti(P%,14,T$):PROCiconupd(P%,12) 6800ENDPROC 6810 6820DEFPROCshowsub 6830LOCALP%:P%=w%(file%,1):PROCseti(P%,19,FNsubdesc) 6840PROCshowsub1:ENDPROC 6850 6860DEFPROCshowsub1:LOCALP%,M%:M%=FNv_(11) 6870P%=w%(file%,2):IFP%>0THEN 6880PROCsubdisp1:PROCunselall(P%):IFM%=0THEN 6890PROCseli(P%,1) 6900ELSE 6910PROCseli(P%,(M%AND31)+28) 6920IFM%>31:PROCseli(P%,(M%AND31)+4) 6930ENDIF 6940ENDIF 6950ENDPROC 6960 6970DEFPROCshowindex:LOCALP%,T%:T%=FNcuridx 6980P%=w%(file%,1):IFT%<=0$sd%=" * No Index *" 6990PROCseti(P%,20,$sd%):PROCmarkidx(T%):lix%=T%:ENDPROC 7000 7010DEFPROCshowfilter 7020LOCALP%,T$:P%=w%(file%,1) 7030IFFNflg(f_filt%)T$=FNtrunc(f$(file%),19):ELSET$=" * No Filter *" 7040PROCseti(P%,21,T$) 7050ENDPROC 7060 7070DEFPROCshowmac 7080LOCALP%,T$:P%=w%(file%,1) 7090IFFNmacmode:PROCseli(P%,18):ELSEPROCunseli(P%,18) 7100ENDPROC 7110 7120DEFFNtrunc(T$,T%):IFLENT$<=T%:=T$:ELSE=LEFT$(T$,T%-3)+"..." 7130 7140DEFPROCshowfound 7150LOCALP%:P%=w%(file%,1) 7160IFfc%(file%)<0THEN 7170PROCseti(P%,24,""):PROCseti(P%,23,"") 7180ELSE 7190PROCseti(P%,23,STR$(fc%(file%))):PROCseti(P%,24,"Found") 7200ENDIF 7210ENDPROC 7220 7230DEFPROCdelfilews(h%):LOCALI%:IFw%(h%,0)>0PROCdelw(w%(h%,0)) 7240FORI%=1TOmaxw%:PROCdelfilew(h%,I%):NEXT:ENDPROC 7250 7260DEFPROCdelfilew(h%,I%) 7270IFw%(h%,I%)>0:PROCclosew(w%(h%,I%)):IFw%(h%,I%)>0PROCdelw(w%(h%,I%)) 7280ENDPROC 7290 7300DEFPROCumess2 7310CASEq%!16OF 7320WHEN6:IFq%!8=loadref%:PROCdatasaveack:ENDPROC 7330WHEN&201:IFq%!8=i_merging%:i_merging%+=1 7340ENDCASE 7350ENDPROC 7360 7370DEFPROCbackgrnd:LOCALT% 7380IFackpending%:ackpending%=FALSE 7390IFsbfile%>=0:PROCsubdisp 7400L%=lastact%:REPEAT 7410L%=(L%+1)MOD(maxf%+1) 7420UNTILL%=lastact%OR(a%(L%)>0ANDL%<>stopfile%) 7430IFa%(L%)=0ORL%=stopfile%:ENDPROC 7440lastact%=L%:PROCsdfile(L%):T%=TIME:CASEa%(L%)OF 7450WHEN1:PROCskip(1) 7460WHEN2:PROCskip(0) 7470WHEN3:PROCsrcnext 7480WHEN4:PROCfsubnxt 7490WHEN5,6:PROCcsubnext(a%(L%)) 7500WHEN7:PROCdsubnxt 7510WHEN8:PROCupdnxt 7520WHEN9:PROCsortnext 7530WHEN10:PROCprintnext 7540WHEN11:PROCi_next 7550ENDCASE 7560IFdelay%<>(2E9)THEN 7570T%=(TIME-T%+4)DIV5:IFT%<0T%=0:ELSEIFT%>50T%=50 7580SYS"OS_ReadMonotonicTime"TOdelay%:delay%+=T% 7590ENDIF 7600ENDPROC 7610 7620DEFPROCtemplate(T$) 7630PROCtemplate1(T$,q%) 7640ENDPROC 7650 7660DEFPROCtemplate1(T$,q%):T$=FNlower(T$):LOCAL I%,T%,L% 7670I%=temp%+16:WHILE!I%>0ANDFNlower($(I%+12))<>T$:I%+=24:ENDWHILE 7680IF!I%<=0:ERROR99,"Template '"+T$+"' not found" 7690T%=temp%+!I%:L%=I%!4:FORI%=0TOL%STEP4:q%!I%=T%!I%:NEXT:T%=q%+88+q%!84*32 7700IF(q%!56)AND(1<<8)THEN 7710q%!72=FNworkspace(q%!80):$(q%!72)=$T%:T%+=LEN$T%+1 7720IFq%!76>0:q%!76=FNworkspace(LEN$T%+1):$(q%!76)=$T%:T%+=LEN$T%+1 7730ENDIF 7740IFq%!84>0THEN 7750FORI%=q%+88TOq%+84+q%!84*32STEP32 7760IF(I%!16)AND(1<<8)THEN 7770I%!20=FNworkspace(I%!28):$(I%!20)=$T%:T%+=LEN$T%+1 7780IFI%!24>0:I%!24=FNworkspace(LEN$T%+1):$(I%!24)=$T%:T%+=LEN$T%+1 7790ENDIF 7800NEXT 7810ENDIF 7820q%!64=sprites% 7830ENDPROC 7840 7850DEFFNtemplate(T$) 7860PROCtemplate1(T$,tbs%) 7870T%=tbs%:tbs%+=88+tbs%!84*32 7880IFtbs%>tbe%:ERROR99,"Template buffer full" 7890=T% 7900 7910DEFPROCopentemplate(A$):temp%=HIMEM-30000 7920LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(69) 7930OSCLI"Load "+A$+" "+STR$~temp%:ENDPROC 7940 7950DEFPROCdefws:LOCALI% 7960LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 7970wts%=6688:wbs%=4413 7980bufsz%=(maxf%+1)*wbs%+8700 7990DIM buffer% bufsz%:curbuf%=buffer%:endbuf%=buffer%+bufsz% 8000RESTOREERROR 8010PROCopentemplate(FNdir+"MSFrm1") 8020LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 8030PROCtemplate("stopbox"):SYS"Wimp_CreateWindow",,q%TOw_stop% 8040PROCtemplate("save") 8050q%!64=1:SYS"Wimp_CreateWindow",,q%TOw_save% 8060PROCtemplate("ProgInfo"):SYS"Wimp_CreateWindow",,q%TOw_pinfo% 8070PROCtemplate("ProgInfo2"):SYS"Wimp_CreateWindow",,q%TOw_pinfo2% 8080PROCtemplate("shadow"):SYS"Wimp_CreateWindow",,q%TOw_shadow% 8090PROCtemplate("Impulse"):SYS"Wimp_CreateWindow",,q%TOw_impulse% 8100bufsz%=(maxf%+1)*wts%+19150 8110DIM template% bufsz%:tbs%=template%:tbe%=tbs%+bufsz% 8120wbs%=curbuf% 8130FORI%=0TOmaxf% 8140tw%(I%,0)=FNtemplate("file") 8150tw%(I%,1)=FNtemplate("filepane") 8160tw%(I%,2)=FNtemplate("subsets") 8170tw%(I%,3)=FNtemplate("FieldList") 8180tw%(I%,4)=FNtemplate("FieldList") 8190tw%(I%,5)=FNtemplate("FieldList") 8200tw%(I%,6)=FNtemplate("Notepad") 8210tw%(I%,7)=FNtemplate("Macro") 8220NEXT 8230wbs%=(curbuf%-wbs%)/(maxf%+1):wts%=(tbs%-template%)/(maxf%+1) 8240REM ;{n wbs% and wts% now contain the min values to use at start of PROC 8250RESTOREERROR 8260PROCopentemplate(FNdir+"MSFrm2") 8270LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 8280tw_expr%=FNtemplate("expression"):w_expr%=-1E9 8290tw_nums%=FNtemplate("numeric"):w_nums%=-1E9 8300tw_sort%=FNtemplate("sort"):w_sort%=-1E9 8310tw_open%=FNtemplate("open"):w_open%=-1E9 8320tw_finf%=FNtemplate("FieldInfo"):w_finf%=-1E9 8330tw_status%=FNtemplate("Status"):w_status%=-1E9 8340tw_rlink%=FNtemplate("rlink"):w_rlink%=-1E9 8350tw_srset%=FNtemplate("srsetup"):w_srset%=-1E9 8360tw_label%=FNtemplate("labels"):w_label%=-1E9 8370tw_line%=FNtemplate("lline"):w_line%=-1E9 8380tw_mess%=FNtemplate("message"):w_mess%=-1E9 8390tw_passw%=FNtemplate("password"):w_passw%=-1E9 8400tw_word%=FNtemplate("wordpro"):w_word%=-1E9 8410tw_pdrive%=FNtemplate("pdriver"):w_pdrive%=-1E9 8420tw_rset1%=FNtemplate("repset1"):w_rset1%=-1E9 8430tw_rset2%=FNtemplate("repset2"):w_rset2%=-1E9 8440tw_rset3%=FNtemplate("repset3"):w_rset3%=-1E9 8450tw_col%=FNtemplate("column"):w_col%=-1E9 8460tw_csize%=FNtemplate("cardsize"):w_csize%=-1E9 8470ENDPROC 8480 8490DEFPROCloadsprites 8500LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 8510ssize%=16*1024 8520DIMsprites% ssize% 8530ONERRORLOCAL:RESTOREERROR:PROCerr(68) 8540!sprites%=ssize%:SYS"OS_SpriteOp",&109,sprites% 8550SYS"OS_SpriteOp",&10A,sprites%,FNdir+"MSSpr" 8560ENDPROC 8570 8580DEFPROCdefmenus:LOCALt$ 8590LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(67) 8600DIM mlist% 32,function% 51 8610bufsz%=&AF0 8620DIM menufree% bufsz%:menuptr%=menufree%:menuend%=menufree%+bufsz% 8630RESTOREERROR 8640menustart%=menufree%:RESTORE+2 8650READt$:m_npad%=FNcrmenu(t$) 8660DATA"#Notepad,Clear,Export>w_save%,Update" 8670READt$:m_main%=FNcrmenu(t$) 8680DATA"#MultiStore,Info>w_pinfo%,Transfer,Fast Sort,Create,Status,Printer,Quit" 8690READt$:m_format%=FNcrmenu(t$) 8700DATA"#Format,Link,Close" 8710t_impulse%=FNworkspace(200):READt$:m_impulse%=FNcrmenu(t$) 8720DATA"#Command,$t_impulse%(199)" 8730READt$:m_macro%=FNcrmenu(t$) 8740DATA"#Macro,Browse Mode,Edit Mode#,Update Cards" 8750READt$:m_macro1%=FNcrmenu(t$) 8760DATA"#Macro,Browse Mode,Edit Mode#,Clear,Export>w_save%" 8770READt$:m_default%=FNcrmenu(t$) 8780DATA"#Default,Show,Use" 8790READt$:m_file%=FNcrmenu(t$) 8800DATA"#File,Search,Sort,Compact,Link,Impulse" 8810READt$:m_wind%=FNcrmenu(t$) 8820DATA"#Window,Subset,Report,Field,Index,Notepad,Macro#,Tidy Up" 8830READt$:m_card1%=FNcrmenu(t$) 8840DATA"#Card,Delete,Remove,Size,Export>w_save%,Impulse>m_impulse%" 8850READt$:m_card%=FNcrmenu(t$) 8860DATA"#Card,Tools>w_pinfo%,Format>m_format%,Macro>m_macro%,Default>m_default%,Card>m_card1%,File>m_file%,Window>m_wind%" 8870t_subd%=FNworkspace(26):READt$:m_subd%=FNcrmenu(t$) 8880DATA"#Description,$t_subd%(25)" 8890READt$:m_nums%=FNcrmenu(t$) 8900DATA"#Numeric,Create,Edit,Delete" 8910READt$:m_subs%=FNcrmenu(t$) 8920DATA"#Subsets,Fill,Clear,Delete,Name>m_subd%,Numeric>m_nums%" 8930READt$:m_rtype%=FNcrmenu(t$) 8940DATA"#Type,Cards,Sheet,Formula,Labels,Wordpro,Paged" 8950READt$:m_rset1%=FNcrmenu(t$) 8960DATA"#Setup,Edit,Clear,Save}w_save%" 8970READt$:m_report%=FNcrmenu(t$) 8980DATA"#Report,Type>m_rtype%,Setup>m_rset1%,Print,Export}w_save%" 8990READt$:m_status%=FNcrmenu(t$) 9000DATA"#Statusmenu..,Align Windows,Read Workspace,Write Workspace,Modernise,Update Media,Password,Extended Charset" 9010t_iexp%=FNtia(tw_expr%,17):READt$:m_index%=FNcrmenu(t$) 9020DATA"#Index.......,Ascending,Descending,No Index#,$t_iexp%(255)" 9030READt$:m_mode%=FNcrmenu(t$) 9040DATA"#Find Mode,Exact,Descending,Fuzzy,Nearest,Sequential,Character" 9050ENDPROC 9060 9070DEFPROCfront(h%,X%,Y%) 9080PROCgetw(h%) 9090IFX%>=0x1%+=X%-x0%:x0%=X% 9100IFY%>=0y1%+=Y%-y0%:y0%=Y% 9110PROCopen(h%,x0%,y0%,x1%,y1%,scx%,scy%,-1) 9120ENDPROC 9130 9140DEFPROCopen(oh%,ox0%,oy0%,ox1%,oy1%,oscx%,oscy%,obh%) 9150LOCALO%,f%:f%=file% 9160!q%=oh%:SYS"Wimp_GetWindowState",,q% 9170PROCwtof(oh%):IFfile%>=0THEN 9180CASEwind%OF 9190WHEN0:PROCopenpane 9200OTHERWISE:PROCwimpopen 9210ENDCASE 9220ELSE 9230CASEoh%OF 9240OTHERWISE:PROCwimpopen 9250ENDCASE 9260ENDIF 9270IFoh%=dialogue%ANDshadows%:PROCgetw(oh%):PROCopen(w_shadow%,x0%+ss%,y0%-ss%,x1%+ss%,y1%-ss%,0,0,dialogue%) 9280open%=O%:IFf%>=0:PROCsdfile(f%) 9290ENDPROC 9300 9310DEFPROCwimpopen 9320!q%=oh%:q%!4=ox0%:q%!8=oy0%:q%!12=ox1%:q%!16=oy1% 9330q%!20=oscx%:q%!24=oscy%:q%!28=obh%:SYS"Wimp_OpenWindow",,q% 9340ENDPROC 9350 9360DEFPROCopenpane 9370IFNOTFNflg(f_pane%):PROCwimpopen:ENDPROC 9380LOCALP%,f%:P%=w%(file%,1) 9390f%=oy1%-paneh%:IFf%<oy0%f%=oy0% 9400PROCgetw(P%) 9410IFbhandle%=obh%ORobh%=w%(file%,0)THEN 9420obh%=P% 9430IFNOTopen%PROCopen(P%,ox0%-panew%-4,f%,ox0%-4,oy1%,0,0,obh%) 9440ENDIF 9450PROCgetw(P%):f%=oy1%-paneh%:IFf%<oy0%f%=oy0% 9460PROCwimpopen 9470PROCgetw(w%(file%,0)):IFobh%=-2:obh%=bhandle% 9480f%=oy1%-paneh%:IFf%<oy0%f%=oy0% 9490PROCopen(P%,x0%-panew%-4,f%,x0%-4,y1%,0,0,obh%) 9500ENDPROC 9510 9520DEFPROCclosew(!q%) 9530LOCALI%,f%:f%=file% 9540PROCwtof(!q%) 9550IFfile%>=0THEN 9560CASEwind%OF 9570WHEN0:IFFNshowbranch:ENDPROC:ELSEIFNOTcloseok%:PROCcloseok:ENDPROC 9580PROCclosefile(file%):PROCnodial:ENDPROC 9590WHEN3:IFfile%=edfile%:IFedrep%:PROCendedit:!q%=w%(file%,3) 9600ENDCASE 9610ENDIF 9620IF!q%=dialogue%:PROCtidydial 9630SYS"Wimp_CloseWindow",,q% 9640PROCnodial:PROCwtof(!q%):IFfile%>=0THEN 9650CASEwind%OF 9660WHEN2,3,4,5,6,7:PROCdelw(w%(file%,wind%)) 9670ENDCASE 9680ELSE 9690CASE!q%OF 9700WHENw_stop%:stopfile%=-1 9710WHENw_expr%:PROCdelw(w_expr%) 9720WHENw_nums%:PROCdelw(w_nums%) 9730WHENw_sort%:PROCdelw(w_sort%) 9740WHENw_open%:PROCdelw(w_open%) 9750WHENw_finf%:PROCdelw(w_finf%) 9760WHENw_status%:PROCdelw(w_status%) 9770WHENw_rlink%:PROCdelw(w_rlink%) 9780WHENw_srset%:PROCdelw(w_srset%) 9790WHENw_label%:PROCdelw(w_label%) 9800WHENw_line%:PROCdelw(w_line%) 9810WHENw_mess%:PROCdelw(w_mess%) 9820WHENw_passw%:PROCdelw(w_passw%) 9830WHENw_word%:PROCdelw(w_word%) 9840WHENw_pdrive%:PROCdelw(w_pdrive%) 9850WHENw_rset1%:PROCdelw(w_rset1%) 9860WHENw_rset2%:PROCdelw(w_rset2%) 9870WHENw_rset3%:PROCdelw(w_rset3%) 9880WHENw_col%:PROCdelw(w_col%) 9890WHENw_csize%:PROCdelw(w_csize%) 9900ENDCASE 9910ENDIF 9920ENDPROC 9930 9940DEFPROCtidydial:PROCrestorect 9950dialreason%=-1:dialogue%=-1:PROCclosew(w_shadow%):exi0%=-1:exi1%=-1 9960dialfile%=-1:ENDPROC 9970 9980DEFPROCrestorect 9990LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 10000SYS "Wimp_GetCaretPosition",,workbuf% 10010IF!workbuf%=dialogue%SYS "Wimp_SetCaretPosition",!dialct%,dialct%!4,dialct%!8,dialct%!12,dialct%!16,dialct%!20 10020ENDPROC 10030 10040DEFPROCdelw(RETURN T%):!q%=T%:SYS"Wimp_DeleteWindow",,q%:T%=-1E9:ENDPROC 10050 10060DEFFNia(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!28 10070DEFFNva(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!32 10080DEFFNil(h%,i%):PROCgeti(h%,i%):PROCchkii:=q%!36 10090 10100DEFFNtia(T%,i%):LOCALq%:q%=T%+32*i%+88:PROCchkii:=q%!20 10110 10120DEFPROCchkii:IF(q%!24AND&100)=0ERROR1,"Icon not indirected "+STR$!q%+" "+STR$q%!4 10130ENDPROC 10140 10150DEFPROCgeti(h%,i%):!q%=h%:q%!4=i%:SYS"Wimp_GetIconState",,q%:ENDPROC 10160 10170DEFFNta(h%):!q%=h%:SYS"Wimp_GetWindowInfo",,q% 10180IF(q%!60AND&100)=0ERROR1,"Title not indirected" 10190=q%!76 10200 10210DEFPROCstop(r%,T$,U$,T%) 10220dialreason%=r%:stopfile%=T% 10230IFINKEY-3ORNOTstopboxes%:mi%=3:PROCmstop:ENDPROC 10240PROCseti(w_stop%,0,T$):PROCseti(w_stop%,1,U$) 10250PROCunselall(w_stop%):PROCdialogue(w_stop%) 10260dialreason%=r%:stopfile%=T% 10270ENDPROC 10280 10290DEFPROCdialogue(h%) 10300LOCALX%,Y%:X%=file%:PROCnodial 10310SYS "Wimp_GetCaretPosition",,dialct% 10320dialfile%=X%:PROCnomenu:PROCreadpointer:X%=mx%-200:Y%=my%-85 10330IFX%<0X%=0 10340IFY%<96Y%=96 10350dialogue%=h% 10360PROCfront(h%,X%,Y%) 10370PROCsetct(h%,-1,-1) 10380IFh%=w_impulse%THEN 10390PROCsetct(h%,9,LEN$FNia(h%,9)) 10400ELSE 10410RESTORE25490:REPEAT 10420PROCreadh(h%):IFh%=dialogue%:READX%:PROCsetct(h%,X%,LEN$FNia(h%,X%)) 10430IFh%<>-1:REPEAT:READX%:UNTILX%<-1:h%=0 10440UNTILh%=dialogue%ORh%<0 10450ENDIF 10460ENDPROC 10470 10480DEFPROCreadpointer:LOCALq%:q%=workbuf% 10490SYS"Wimp_GetPointerInfo",,q% 10500mx%=!q%:my%=q%!4:mb%=q%!8:mh%=q%!12:mi%=q%!16 10510ENDPROC 10520 10530DEFFNdialogue:LOCALfile% 10540IFdialogue%>=0ANDmh%<>dialogue%ANDmh%<>w_shadow%PROCnodial 10550=FALSE 10560 10570DEFPROCmouse(mx%,my%,mb%,mh%,mi%,mo%) 10580IFdragreason%>=0ORmb%>255:ENDPROC 10590PROCwtof(mh%):IFfile%>=0ANDwind%=6AND(mb%=1ORmb%=4)ANDmi%<19:ENDPROC 10600IFmb%<16:IFFNdialogue:ENDPROC 10610w_info%=w_pinfo%:IFmb%=7:mb%=2:w_info%=w_pinfo2% 10620CASEmb%OF 10630WHEN2:PROCmenu 10640WHEN1,4:PROCselect 10650WHEN16,64:PROCstartdrag 10660ENDCASE 10670ENDPROC 10680 10690DEFPROCseti(h%,i%,T$):T$=LEFT$(T$,FNil(h%,i%)):$FNia(h%,i%)=T$ 10700PROCiconupd(h%,i%):PROCgetct:IF!q%=h%ANDq%!4=i%:PROCsetct(h%,i%,LENT$) 10710ENDPROC 10720 10730DEFPROCiset(h%,i%,B%,E%):LOCALq%:q%=workbuf% 10740!q%=h%:q%!4=i%:q%!12=B%:q%!8=E%:SYS"Wimp_SetIconState",,q%:ENDPROC 10750 10760DEFPROCiconupd(h%,i%):PROCiset(h%,i%,0,0):ENDPROC 10770 10780DEFPROCforce(h%) 10790CASEh%OF 10800OTHERWISESYS"Wimp_ForceRedraw",h%,-1E9,-1E9,1E9,1E9 10810ENDCASE 10820ENDPROC 10830 10840DEFPROCreadblock(p%) 10850x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12:REM physical area 10860scx%=p%!16:scy%=p%!20:bhandle%=p%!24:REM scroll offsets, stack depth 10870bx%=x0%-scx%:by%=y1%-scy%:REM calculate physical co-ords of logical area 10880ex0%=p%!40:ey0%=p%!44:ex1%=p%!48:ey1%=p%!52:REM logical area 10890gx0%=p%!24:gy0%=p%!28:gx1%=p%!32:gy1%=p%!36:REM graphics window 10900open%=(p%!28AND&10000)<>0:REM window open flag 10910ENDPROC 10920 10930DEFPROCgetw(h%) 10940!q%=h%:SYS"Wimp_GetWindowInfo",,q% 10950PROCreadblock(q%+4) 10960ENDPROC 10970 10980DEFPROCselect 10990PROCwtof(mh%):IFfile%>=0THEN 11000CASEwind%OF 11010WHEN0:PROCmcard 11020WHEN1:PROCmpane 11030WHEN2:PROCmsubs 11040WHEN3:PROCmrep 11050WHEN4:PROCmflist 11060WHEN5:PROCmilist 11070ENDCASE 11080ELSE 11090IFFNnumi(mh%,mi%,mb%) 11100IFmh%=dialogue%:IFdialfile%>=0:PROCsdfile(dialfile%) 11110CASEmh%OF 11120WHEN-2:IFmb%=1ANDINKEY-1ANDINKEY-2:PROCoscli(""):ELSEPROCstatus 11130WHENw_open%:PROCmopen 11140WHENw_stop%:PROCmstop 11150WHENw_sort%:PROCmsort 11160WHENw_save%:PROCmsave 11170WHENw_expr%:PROCmexpr 11180WHENw_nums%:PROCmnums 11190WHENw_finf%:PROCmfinf 11200WHENw_status%:PROCmstatus 11210WHENw_rlink%:PROCmrlink 11220WHENw_srset%:PROCmsrset 11230WHENw_label%:PROCmlabel 11240WHENw_line%:PROCmline 11250WHENw_mess%:IFmi%=6:PROCclosew(w_mess%) 11260WHENw_passw%:PROCmpassw 11270WHENw_word%:PROCmword 11280WHENw_pdrive%:PROCmpdrive 11290WHENw_rset1%:PROCmrset1 11300WHENw_rset2%:PROCmrset2 11310WHENw_rset3%:PROCmrset3 11320WHENw_col%:PROCmcol 11330WHENw_csize%:PROCmcsize 11340WHENw_impulse%:PROCmimpulse 11350ENDCASE 11360ENDIF 11370ENDPROC 11380 11390DEFPROCmcard 11400menufield%=FNmousef:IFmenufield%>0THEN 11410IFmb%=1:PROCfinfo(FALSE):ELSEPROCfedit 11420ENDIF 11430ENDPROC 11440 11450DEFPROCmflist:LOCALY%:Y%=my%:PROCyconv(Y%,FNv_(7),mh%) 11460menufield%=Y%:IFmb%=1:PROCfinfo(FALSE):ELSEPROCfindfield 11470ENDPROC 11480 11490DEFPROCmilist:LOCALY%:Y%=my%:PROCyconv(Y%,FNnindices,mh%) 11500IFY%>0:IFNOTFNdeadfile(-1):PROCselindex(Y%,0) 11510ENDPROC 11520 11530DEFPROCmpane 11540CASEmi%OF 11550WHEN0:PROCbof 11560WHEN1:PROCback 11570WHEN2:PROCpause 11580WHEN3:PROCfwd 11590WHEN4:PROCeof 11600WHEN5:PROCffind 11610WHEN6:PROCnextmatch 11620WHEN12:PROCgauge 11630WHEN14:PROCcardnum 11640WHEN15:PROCfback 11650WHEN16:PROCffwd 11660WHEN17:PROCadd 11670WHEN18:IFmb%=4PROCemacro:ELSEIFs%(file%)=0:PROCmacro 11680WHEN19:IFmb%=1:PROCselsub(0):ELSEPROCsubs 11690WHEN20:IFmb%=1ANDNOTFNdeadfile(-1):PROCselindex(0,0):ELSEPROCindex 11700WHEN21:PROCfilter 11710WHEN22:PROCcard 11720ENDCASE 11730ENDPROC 11740 11750DEFPROCmsubs 11760IFFNdeadfile(%11111111111111110)ENDPROC 11770LOCALT%:T%=FNitos:IFT%>=0:PROCselsub(T%):ENDPROC 11780ENDPROC 11790 11800DEFPROCmrep 11810CASEr%(file%)OF 11820WHEN0,1,2:PROCmrep1 11830WHEN3:PROCmrep3 11840WHEN5:PROCmrep5 11850ENDCASE:ENDPROC 11860 11870DEFPROCmrep1 11880IFfile%<>edfile%ORNOTedrep%IFFNdeadfile(-1):ENDPROC 11890LOCALX%,Y%,T%,h%:PROCgetw(mh%):h%=1 11900IFr%(file%)=1:T%=2:ELSEIFr%(file%)=0:h%=FNrht 11910Y%=(by%-my%-margin%-T%*linegap%)DIV(linegap%*h%):IFY%<0:ENDPROC 11920Y%+=1:IFY%>FNv_(17)ENDPROC 11930SYSswi%,grec_%,Y%TON% 11940PROCvalidrec1:IFr%(file%)<>1:ENDPROC 11950IFf%(file%)>0PROCerr(73) 11960PROCgetw(mh%):X%=(mx%-bx%-margin%-11*16)DIV16:IFX%<1:ENDPROC 11970IFX%<=LENFNsrep(1)PROCedrep(X%,FNv_(15)) 11980ENDPROC 11990 12000DEFPROCmrep3:IFFNdeadfile(-1):ENDPROC 12010LOCALY%:PROCgetw(mh%):Y%=(by%-my%-margin%)DIVlinegap% 12020IFY%<0Y%=0ELSEIFY%>ll%(file%,3)-1Y%=ll%(file%,3)-1 12030IFY%>15ENDPROC 12040w_line%=FNcrwind(tw_line%):PROCunselall(w_line%):menufield%=Y% 12050PROCseli(w_line%,FNjustl(Y%)):PROCseli(w_line%,FNfontl(Y%)+5) 12060IFFNspcl(Y%):PROCseli(w_line%,9) 12070IFFNuppl(Y%):PROCseli(w_line%,10) 12080IFFNfixl(Y%):PROCseli(w_line%,11) 12090$FNta(w_line%)="Line "+STR$(Y%+1):PROCdialogue(w_line%):ENDPROC 12100 12110DEFPROCmrep5:IFFNdeadfile(-1):ENDPROC 12120LOCALX%,Y%,I%:PROCgetw(mh%):Y%=(by%-my%-margin%)DIVlinegap% 12130IFY%<4PROCrset51:ENDPROC 12140IFY%>8ANDY%<12PROCrset52:ENDPROC 12150IFY%>12PROCrset53:ENDPROC 12160PROCmousecol:IFcolumn%<0PROCaddcolumn 12170PROCedcol:ENDPROC 12180 12190DEFPROCmstop 12200IFmi%<3ORmi%>4ENDPROC 12210LOCALT%,U%:U%=stopfile%:T%=dialreason%:dialreason%=-1 12220IFmi%=3THEN 12230PROCclosew(w_stop%):IFU%>=0:PROCsdfile(U%) 12240CASET%OF 12250WHEN2:closeok%=TRUE:PROCclosew(w%(file%,0)) 12260WHEN3:PROCcompact:ENDPROC 12270WHEN4:PROCfillsub(TRUE) 12280WHEN5:PROCfillsub(FALSE) 12290WHEN6:PROCCLOSE:PROCquit(FALSE) 12300WHEN7:PROCendsearch 12310WHEN8:SYSswi%,namewrite_%,"",0,menusub%-256TOG%:PROCmakesubs(file%) 12320WHEN9:PROCendfill 12330WHEN10:PROCdelcard 12340WHEN11:PROCstartact(5) 12350WHEN12:PROCstartact(6) 12360WHEN13:PROCendcsub 12370WHEN14:PROCloadnotes 12380WHEN15:PROCdelsub 12390WHEN16:PROCenddsub 12400WHEN17:PROCclearnpad 12410WHEN18:PROCclearmacro 12420WHEN19:PROCloadmacro 12430WHEN20:stopboxes%=FALSE 12440WHEN21:PROCcopycard1 12450WHEN22:PROCupdcards 12460WHEN23:PROCendact 12470WHEN24:PROCendact 12480WHEN25:PROCendact 12490WHEN26:PROCasccard 12500WHEN27:SYSswi%,setpass_%,"" 12510WHEN28:PROCloadsetup 12520WHEN29:p$(file%,0)="":PROCmakerep(file%) 12530WHEN30:ll%(file%,0)=0:PROCmakerep(file%) 12540WHEN31:wo%(file%)=-1:PROCmakerep(file%) 12550WHEN32:SYSswi%,sd21_%,tx0%,ty0%,menufield%,sd$ 12560PROCforcecard:IFr%(file%)=0:PROCforcerep 12570WHEN33:PROCr_clear:PROCforcerep 12580WHEN34:PROCdelcol(menucol%) 12590WHEN35:PROCinscol(menucol%) 12600WHEN36:OSCLI"*settype "+file$+" "+STR$~menufield% 12610IFmenufield%=ft_data%:PROCopenfile(file$):ENDPROC:ELSEPROCerr(1) 12620WHEN37:PROCimportasc 12630WHEN38:PROCpicpath 12640WHEN39:PROCCLOSE:PROCcreate 12650WHEN40:IFi_merging%<100i_merging%=100 12660ENDCASE 12670ELSE 12680IFT%=1:PROCCLOSE:PROCquit(FALSE) 12690ENDIF 12700PROCclosew(w_stop%) 12710ENDPROC 12720 12730DEFPROCmsave 12740IFmi%<>0ENDPROC 12750LOCALT$:T$=$FNia(w_save%,2):IFT$=FNleaf(T$):PROCerr(5) 12760savetype%=savet%:file$=T$:task%=-1:PROCsavedata1 12770ENDPROC 12780 12790DEFPROCmsort:LOCALI% 12800IFmi%<>6ANDmi%<>7:ENDPROC 12810IFmi%=7PROCnodial:ENDPROC 12820PROCwchi(w_sort%):o%(file%,0)=0:I%=q%:REPEAT:CASE!I%OF 12830WHEN3:o%(file%,0)=o%(file%,0)OR1 12840WHEN5:o%(file%,0)=o%(file%,0)OR2 12850ENDCASE:I%+=4:UNTILI%!-4<0 12860o$(file%)=$FNia(w_sort%,2):ox$(file%)=FNx3(o$(file%)) 12870PROCstartsort:PROCnodial:ENDPROC 12880 12890DEFPROCstartsort:IFFNv_(17)<2ENDPROC 12900PROCnofilt:PROCselsub(0):PROCselindex(0,0) 12910o%(file%,5)=FNv_(17)DIV2:o%(file%,4)=0 12920PROCstartact(9):ENDPROC 12930 12940DEFPROCswaprec(A%,B%) 12950SYSswi%,sd32_%,A%,B% 12960ENDPROC 12970 12980DEFFNso(I%):LOCALU%:LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(34) 12990SYSswi%,grec_%,I%TON% 13000PROCrlink(TRUE):=FNev4(ox$(file%),TRUE,(o%(file%,0)AND2)=2) 13010 13020DEFPROCmnums:IFmi%<>4ANDmi%<>5:ENDPROC 13030LOCALT%,B%,T$:IFmi%=5THEN 13040B%=VAL$FNia(w_nums%,3):IFB%=0:PROCerr(14) 13050T%=0:WHILE2^T%<=B%:T%+=1:ENDWHILE:B%=2^T%-1 13060T$=FNup(FNs($FNia(w_nums%,2))):IFLENT$<2ORASCT$>90ORASCT$<65:PROCerr(13) 13070CASEdialreason%OF 13080WHEN0 13090T%=TRUE:LOCALERROR 13100ONERRORLOCAL:T%=FALSE 13110IFT%:SYSswi%,nameread_%,T$TOG%:hh 13120RESTOREERROR:IFT%:PROCerr(15) 13130T%=0:WHILEFNsubname(T%)<>"":T%+=1:ENDWHILE 13140SYSswi%,namewrite_%,T$,B%,-1TOG% 13150WHEN1 13160IFFNsubmax(menusub%-256)<>B%THEN 13170SYSswi%,namewrite_%,T$,B%,menusub%-156TOG% 13180ELSE 13190SYSswi%,sd53_%,menusub%-256TOG% 13200SYSswi%,namewrite_%,T$,G%,menusub%-256TOG% 13210ENDIF 13220ENDCASE 13230PROCmakesubs(file%):PROCshowsub 13240ENDIF 13250PROCnodial:ENDPROC 13260 13270DEFPROCmopen:IFmi%=11PROCclosew(w_open%) 13280IFmi%<>12ENDPROC 13290LOCALI%,m%,d%,r%,p$ 13300p$=$FNia(w_open%,14):PROCwchi(w_open%):I%=q%:REPEAT 13310IF!I%=0:d%=TRUE 13320IF!I%>0AND!I%<9:m%=!I%-1 13330IF!I%=16:r%=TRUE 13340I%+=4:UNTILI%!-4<0:file$=$FNia(w_open%,13):PROCclosew(w_open%) 13350PROCopenfile1(file$,m%,d%,p$,r%):ENDPROC 13360 13370DEFPROCmcsize:LOCALw%,h%,I% 13380CASEmi%OF 13390WHEN65:PROCnodial 13400WHEN64:PROCsdfile(dialfile%) 13410w%=VAL$FNia(w_csize%,61) 13420h%=VAL$FNia(w_csize%,57) 13430FORI%=1TO2 13440SYSswi%,width_%,w% 13450SYSswi%,height_%,h% 13460NEXT 13470PROCfext:PROCforcecard:PROCnodial 13480ENDCASE:ENDPROC 13490 13500DEFPROCmexpr 13510LOCALA%,T$,c%,s%,u%,I%,Q%,B% 13520PROCunseli(w_expr%,29):PROCunseli(w_expr%,24) 13530A%=FNia(w_expr%,17):PROCsdfile(dialfile%):PROCqbscan($A%,Q%,B%) 13540CASEmi%OF 13550WHEN2,3,4,5,6,7,8,9 13560IF$A%>""ANDNOTQ%$sd%=MID$("+-*/=<><()",mi%-1,1):IF$sd%<>RIGHT$($A%)T$=$sd% 13570IFmi%=7:IFT$>"":T$+=">" 13580PROCseti(w_expr%,17,$A%+T$) 13590WHEN10,11 13600IF(($A%>""ANDB%>0)ORmi%=10)ANDNOTQ%:$sd%=MID$("()",mi%-9,1):PROCseti(w_expr%,17,$A%+$sd%) 13610WHEN12,13 13620T$=$A%:IF$A%>""ANDNOTQ%THEN 13630$sd%=RIGHT$($A%):SYSswi%,upper_% 13640IF($sd%>="A"AND$sd%<="Z")OR($sd%>="0"AND$sd%<="9")T$+=" " 13650IFmi%=12T$+="AND"ELSET$+="OR" 13660ENDIF 13670PROCseti(w_expr%,17,T$) 13680WHEN14:IF$A%>""ANDNOTQ%T$=$A%+"=""**""":PROCseti(w_expr%,17,T$):PROCsetct(w_expr%,17,LEN$A%-2) 13690WHEN15:IF$A%>""ANDNOTQ%T$=$A%+"~=""""":PROCseti(w_expr%,17,T$):PROCsetct(w_expr%,17,LEN$A%-1) 13700WHEN20,21:PROCsubs 13710WHEN22:PROCnodial 13720WHEN26:PROCnofilt:PROCnodial 13730WHEN24:IF$A%=""PROCseti(w_expr%,17,ex$):ELSEex$=$A%:PROCseti(w_expr%,17,"") 13740IFdialreason%=0:PROCseli(w_expr%,0):PROCseli(w_expr%,1) 13750WHEN29:PROCseti(w_expr%,17,f$(file%)) 13760WHEN23 13770PROCwchi(w_expr%):I%=q%:REPEAT 13780CASE!I%OF 13790WHEN1:s%=TRUE 13800WHEN0:u%=TRUE 13810WHEN28:c%=TRUE 13820ENDCASE 13830I%+=4:UNTILI%!-4=-1 13840PROCconv($A%):IFu%:PROCupplit($A%) 13850PROCseti(w_expr%,17,$A%) 13860CASEdialreason%OF 13870WHEN0:PROCsetfilt 13880WHEN1:PROCsearch 13890WHEN2:PROCrset2 13900ENDCASE 13910PROCnodial 13920ENDCASE 13930PROCiconupd(w_expr%,17) 13940ENDPROC 13950 13960DEFPROCmfinf 13970CASEmi%OF 13980WHEN17:PROCclosew(w_finf%) 13990WHEN7:PROCgeti(w_finf%,7):IF(q%!24)AND(1<<21)THEN 14000PROCgeti(w_finf%,12):IF((q%!24)AND(1<<21))=0THEN 14010PROCunseli(w_finf%,10):PROCseli(w_finf%,11) 14020ENDIF 14030ENDIF 14040WHEN13,14,15 14050PROCunseli(w_finf%,10):PROCunseli(w_finf%,11):PROCseli(w_finf%,12) 14060WHEN19 14070LOCALT$,T%,B%,L%,K%,I% 14080IFw%(file%,4)>0PROCforce(w%(file%,4)) 14090T$=$FNia(w_finf%,5):T%=VAL$FNia(w_finf%,2):IFT%<1T%=1ELSEIFT%>255T%=255 14100B%=ASCFNup(T$):IFB%<65ORB%>90PROCerr(16) 14110L%=VAL$FNia(w_finf%,20):IFL%<1L%=1ELSEIFL%>255L%=255 14120B%=VAL$FNia(w_finf%,13):IFB%<0B%=0ELSEIFB%>6B%=6 14130K%=FALSE:PROCwchi(w_finf%):I%=q%:REPEAT 14140CASE!I%OF 14150WHEN6:K%=TRUE 14160WHEN7:B%=B%OR8 14170WHEN8:B%=B%OR128 14180WHEN9:B%=B%OR64 14190WHEN10:B%=B%OR7 14200WHEN11:B%=B%ANDNOT7 14210ENDCASE 14220I%+=4:UNTILI%!-4<0 14230SYSswi%,sd18_%,B%,4,menufield%,sd$ 14240SYSswi%,sd20_%,T$,menufield%,sd$ 14250PROCsdfile(file%) 14260IFdialreason%THEN 14270SYSswi%,makekey_%,menufield% 14280SYSswi%,flength_%,L%,menufield% 14290SYSswi%,fnumber_%,T%,menufield% 14300menufield%=T% 14310ENDIF 14320T%=file%:PROCclosew(w_finf%):PROCsdfile(T%):PROCvalidatelink 14330PROCflg(f_pics%,FNisfield("PIC")) 14340ENDCASE 14350ENDPROC 14360 14370DEFPROCmrlink 14380CASEmi%OF 14390WHEN6:IFl%(file%)>0:PROCunlink 14400WHEN7 14410WHEN8 14420LOCALT$,I%,T%:T%=FNfilenum($FNia(w_rlink%,1)):IFT%<0:PROCerr(38) 14430I%=file%:PROCsdfile(T%):IFFNdeadfile1(%11111111101011110)PROCerr(39) 14440PROCsdfile(I%):lk$(file%)=FNs($FNia(w_rlink%,3)) 14450I%=ASClk$(file%):IFI%>32ANDI%<>64ANDI%<>35ANDI%<>124lk$(file%)="@"+lk$(file%) 14460l$(file%)=$FNia(w_rlink%,5):lx$(file%)=FNx4(l$(file%)):PROCchkloop(T%) 14470PROCselsub(0):PROCnofilt:l%(file%)=T%+1:links%+=1:PROCforcecard 14480PROCsdfile(T%):PROCvalidrec:PROCforcerep 14490OTHERWISE:ENDPROC 14500ENDCASE 14510PROCclosew(w_rlink%):ENDPROC 14520 14530DEFFNfilenum(T$):LOCALI%,T%:T%=-1:T$=FNsu(T$):FORI%=0TOmaxf% 14540IFw%(I%,0)>0:IFFNup(FNofilename(I%))=T$:T%=I%:I%=maxf% 14550NEXT:=T% 14560 14570DEFPROCchkloop(T%) 14580IFT%=file%:PROCerr(40):ELSEIFl%(T%)>0PROCchkloop(l%(T%)-1) 14590ENDPROC 14600 14610DEFPROCmstatus 14620LOCALT%,I%,A%,P% 14630CASEmi%OF 14640WHEN15,16,17,18,19,20,21,22 14650T%=FNstatf:IFT%>=0PROCfront(w%(T%,0),-1,-1):ELSEENDPROC 14660WHEN12 14670WHEN13 14680P%=pix%:sound%=FALSE:shadows%=FALSE:pix%=FALSE 14690PROCwchi(w_status%):I%=q%:REPEAT 14700CASE!I%OF 14710WHEN24:sound%=TRUE 14720WHEN25:shadows%=TRUE 14730WHEN28:pix%=TRUE 14740WHEN23:A%=TRUE 14750ENDCASE 14760I%+=4:UNTILI%!-4<0 14770IFsound%:SYSswi%,opt_%,10:ELSESYSswi%,opt_%,9 14780IFpix%<>P%THEN 14790FORI%=0TOmaxf%:IFw%(I%,0)>0PROCforce(w%(I%,0)) 14800NEXT 14810ENDIF 14820IFA%<>stopboxes%THEN 14830IFA%stopboxes%=TRUE:ELSEPROCstop(20,rl$+"disable these","stop boxes ?",-1):ENDPROC 14840ENDIF 14850OTHERWISEENDPROC 14860ENDCASE 14870PROCclosew(w_status%):ENDPROC 14880 14890DEFPROCmsrset 14900LOCALT$,I%:PROCunseli(w_srset%,9) 14910CASEmi%OF 14920WHEN6 14930T$=FNx5($FNia(w_srset%,3)):srx$(file%)=T$:sr$(file%)=$FNia(w_srset%,3) 14940PROCflg(f_stot%,FALSE):PROCflg(f_srup%,FALSE) 14950PROCflg(f_stit%,FALSE):PROCflg(f_sdas%,FALSE) 14960PROCwchi(w_srset%):I%=q%:REPEAT:CASE!I%OF 14970WHEN0:PROCflg(f_srup%,TRUE) 14980WHEN1:PROCflg(f_stot%,TRUE) 14990WHEN7:PROCflg(f_stit%,TRUE) 15000WHEN8:PROCflg(f_sdas%,TRUE) 15010ENDCASE:I%+=4:UNTILI%!-4<0:PROCforcerep 15020PROCnodial 15030WHEN5:PROCnodial 15040WHEN9:IF$FNia(w_srset%,3)=""PROCseti(w_srset%,3,ex$):ELSEex$=$FNia(w_srset%,3):PROCseti(w_srset%,3,"") 15050ENDCASE 15060ENDPROC 15070 15080DEFPROCmlabel:IFmi%=29:PROCclosew(w_label%):ENDPROC 15090LOCALI%,A%:RESTORE15170 15100IFmi%>27ANDmi%<32FORI%=0TO7:READA%:ll%(file%,I%)=VAL$FNia(w_label%,A%):NEXT:PROCrext:PROCforcerep 15110CASEmi%OF 15120WHEN31:PROCprintone 15130WHEN30:PROCtestlab 15140ENDCASE:PROClwidth 15150IFmi%>27ANDmi%<32:PROCclosew(w_label%) 15160ENDPROC 15170DATA12,41,23,6,15,19,48,52 15180 15190DEFPROCmline:IFmi%=13:PROCclosew(w_line%):ENDPROC 15200IFmi%<>12ENDPROC 15210LOCALI%,T%,V%:T%=menufield%:PROCwchi(w_line%):V%=0:I%=q% 15220REPEAT:CASE!I%OF 15230WHEN1:V%=(V%ANDNOT3)OR1 15240WHEN2:V%=(V%ANDNOT3)OR2 15250WHEN6:V%=(V%ANDNOT12)OR(1<<2) 15260WHEN7:V%=(V%ANDNOT12)OR(2<<2) 15270WHEN9:V%=V%OR16 15280WHEN10:V%=V%OR32 15290WHEN11:V%=V%OR64 15300ENDCASE:I%+=4:UNTILI%!-4<0:lf%(file%,T%)=V% 15310PROCforcerep:PROCclosew(w_line%):ENDPROC 15320 15330DEFPROCmpassw:IFmi%=4:PROCclosew(w_passw%) 15340IFmi%<>3ENDPROC 15350LOCALT$,t$:T$=FNsu($FNia(w_passw%,5)):PROCsdfile(dialfile%):SYSswi%,sd63_%,T$TOG% 15360IFG%=2:PROCsetct(w_passw%,5,LEN$FNia(w_passw%,5)):PROCerr(51) 15370T$=FNsu($FNia(w_passw%,1)):t$=FNsu($FNia(w_passw%,2)) 15380IFT$<>t$:PROCerr(47) 15390IFT$="":PROCstop(27,fi$+FNfilename,rl$+"delete password ?",file%):ENDPROC 15400SYSswi%,setpass_%,T$ 15410PROCclosew(w_passw%):ENDPROC 15420 15430DEFPROCmword:IFmi%=43PROCclosew(w_word%) 15440IFmi%<>42ENDPROC 15450LOCALI%:FORI%=0TO14:w$(file%,I%)=$FNia(w_word%,I%):NEXT 15460PROCflg0(f_wspc%):PROCflg0(f_wupp%):PROCflg0(f_wbnk%) 15470wo%(file%)=0:PROCwchi(w_word%):I%=q%:REPEAT:CASE!I%OF 15480WHEN40:PROCflg1(f_wspc%) 15490WHEN41:PROCflg1(f_wupp%) 15500WHEN44:PROCflg1(f_wbnk%) 15510ENDCASE:IF!I%>29AND!I%<40:wo%(file%)=!I%-30 15520I%+=4:UNTILI%!-4<0:PROCforcerep:PROCclosew(w_word%):ENDPROC 15530 15540DEFPROCmpdrive:IFmi%=19:PROCclosew(w_pdrive%) 15550IFmi%<>18ANDmi%<>20ANDmi%<>22ENDPROC 15560LOCALI% 15570I%=q%:pterm%=2:pdriver%=FALSE:manual%=FALSE 15580PROCwchi(w_pdrive%):REPEAT:CASE!I%OF 15590WHEN14,15,16:pterm%=!I%-14 15600WHEN17:pdriver%=TRUE 15610WHEN23:manual%=TRUE 15620ENDCASE:I%+=4:UNTILI%!-4<0 15630PDto$(1)=FNPConv($FNia(w_pdrive%,7)):PDclen%(1)=Length 15640PDto$(2)=FNPConv($FNia(w_pdrive%,8)):PDclen%(2)=Length 15650PROCPDrdfont(1):PROCPDrdfont(2):PROCPDrdfont(3) 15660PDreset$=FNPConv($FNia(w_pdrive%,13)):PDff$=FNPConv($FNia(w_pdrive%,12)) 15670CASEmi%OF 15680WHEN20:PROCPDtest 15690WHEN22:PROCclosew(w_pdrive%):PROCsavew(f_pd$,&D7B,9,-1,512) 15700OTHERWISE:PROCclosew(w_pdrive%) 15710ENDCASE 15720ENDPROC 15730 15740DEFPROCmrset1:IFmi%=6:PROCclosew(w_rset1%):ENDPROC 15750IFmi%<5ORmi%>10ENDPROC 15760LOCALf%,I% 15770PROCwchi(w_rset1%):I%=q%:PROCflg0(f_rldu%):PROCflg0(f_rlsu%):REPEAT 15780CASE!I%OF 15790WHEN36:PROCflg1(f_rldu%) 15800WHEN37:PROCflg1(f_rlsu%) 15810ENDCASE:I%+=4:UNTILI%!-4<0 15820FORI%=0TO3:p$(file%,I%)=$FNia(w_rset1%,I%+1):NEXT 15830f%=file%:PROCnodial:PROCsdfile(f%):PROCforcerep 15840CASEmi%OF 15850WHEN9:PROCrset53 15860WHEN10:PROCrset52 15870WHEN7:PROCpreview 15880WHEN8:PROCdefaultrep 15890ENDCASE 15900ENDPROC 15910 15920DEFPROCmrset2:IFmi%=1:PROCclosew(w_rset2%):ENDPROC 15930IFmi%>5ORmi%<0ENDPROC 15940LOCALf%,I% 15950PROCwchi(w_rset2%):I%=q%:PROCflg0(f_rtpg%):PROCflg0(f_rtsu%):REPEAT 15960CASE!I%OF 15970WHEN51:PROCflg1(f_rtpg%) 15980WHEN52:PROCflg1(f_rtsu%) 15990ENDCASE:I%+=4:UNTILI%!-4<0 16000FORI%=0TO3:p$(file%,I%+4)=$FNia(w_rset2%,I%+42):NEXT 16010f%=file%:PROCnodial:PROCsdfile(f%):PROCforcerep 16020CASEmi%OF 16030WHEN4:PROCrset53 16040WHEN5:PROCrset51 16050WHEN2:PROCpreview 16060WHEN3:PROCdefaultrep 16070ENDCASE 16080ENDPROC 16090 16100DEFPROCmrset3:IFmi%=3:PROCclosew(w_rset3%):ENDPROC 16110PROCrmargin:IF(mi%>4ANDmi%<>35)ORmi%<0ENDPROC 16120LOCALf%,I%,A% 16130PROCflg0(f_rejb%ORf_reja%ORf_rdsp%ORf_rtpn%ORf_rbpn%ORf_rpdt%) 16140I%=q%:PROCwchi(w_rset3%):REPEAT:CASE!I%OF 16150WHEN29:PROCflg1(f_rejb%) 16160WHEN30:PROCflg1(f_reja%) 16170WHEN31:PROCflg1(f_rdsp%) 16180WHEN32:PROCflg1(f_rtpn%) 16190WHEN33:PROCflg1(f_rbpn%) 16200WHEN34:PROCflg1(f_rpdt%) 16210ENDCASE:I%+=4:UNTILI%!-4<0 16220RESTORE+1:FORI%=0TO4:READA%:p%(file%,I%)=VAL$FNia(w_rset3%,A%):NEXT 16230IFp%(file%,4)<6ANDp%(file%,4)<>0p%(file%,4)=6 16240IFp%(file%,3)>p%(file%,4)ANDp%(file%,4)<>0p%(file%,3)=p%(file%,4) 16250IFp%(file%,0)<5)p%(file%,0)=5 16260IFp%(file%,2)>p%(file%,0)p%(file%,2)=p%(file%,0) 16270IFp%(file%,1)+p%(file%,2)>p%(file%,0)p%(file%,1)=p%(file%,0)-p%(file%,2) 16280f%=file%:PROCnodial:PROCsdfile(f%):PROCforcerep 16290CASEmi%OF 16300WHEN1:PROCrset52 16310WHEN2:PROCrset51 16320WHEN4:PROCpreview 16330WHEN5:PROCdefaultrep 16340ENDCASE 16350ENDPROC 16360DATA7,12,16,26,22 16370 16380DEFPROCmcol 16390LOCALT$,I%,T%:I%=menucol%:column%=I% 16400CASEmi%OF 16410WHEN5,9:PROCseli(w_col%,25):PROCunseli(w_col%,27):ENDPROC 16420WHEN21,28,29,18,20,3,4,33,34,35,36,37,38,39,40:PROCseli(w_col%,27):PROCunseli(w_col%,25):ENDPROC 16430WHEN43:PROCclosew(w_col%):ENDPROC 16440WHEN45:PROCstop(34,"Column "+STR$(menucol%+1),rl$+"delete column ?",file%):ENDPROC 16450WHEN46:PROCstop(35,"Column "+STR$(menucol%+1),rl$+"insert column ?",file%):ENDPROC 16460ENDCASE:IFmi%<>42ENDPROC 16470T$=FNx7($FNia(w_col%,22)):c$(file%,I%,0)=$FNia(w_col%,22) 16480c$(file%,I%,1)=$FNia(w_col%,24):T%=VAL$FNia(w_col%,10) 16490IFT%<1T%=1:ELSEIFT%>254T%=254 16500PROCsetcol(T%,255,0):T%=q%:cjus%=0:cfnt%=1:cdup%=FALSE 16510cdps%=VAL$FNia(w_col%,19):IFcdps%<0cdps%=0:ELSEIFcdps%>6cdps%=6 16520cupp%=FALSE:cspc%=FALSE:ctot%=0:ccma%=FALSE:cbk0%=FALSE:cfrm%=0 16530PROCwchi(w_col%):REPEAT:CASE!T%OF 16540WHEN31,32:cjus%=!T%-31 16550WHEN2:cjus%=2 16560WHEN6,7,8:cfnt%=!T%-5 16570WHEN25:cdps%=7 16580WHEN5:cupp%=TRUE 16590WHEN9:cspc%=TRUE 16600WHEN21:ctot%=ctot%OR4 16610WHEN28:ctot%=ctot%OR1 16620WHEN29:ctot%=ctot%OR2 16630WHEN3:cbk0%=TRUE 16640WHEN4:ccma%=TRUE 16650WHEN47:cdup%=TRUE 16660WHEN33,34,35,36,37,38,39,40:cfrm%=!T%-33 16670ENDCASE:T%+=4:UNTILT%!-4<0 16680PROCsetcol(cjus%,3,8):PROCsetcol(cfnt%,3,10):PROCsetcol(cupp%,1,12) 16690PROCsetcol(cspc%,1,13):PROCsetcol(cdps%,7,14):PROCsetcol(ctot%,3,17) 16700PROCsetcol(cbk0%,1,19):PROCsetcol(ccma%,1,20):PROCsetcol(cfrm%,7,21) 16710PROCsetcol(cdup%,1,24):PROCsetcol(ctot%>>>2,1,25) 16720PROCforcerep:PROCclosew(w_col%):ENDPROC 16730 16740DEFPROCmimpulse 16750CASEmi%OF 16760WHEN5:PROCi_def1 16770WHEN6:PROCnodial:ENDPROC 16780WHEN7:PROCi_startmerge 16790ENDCASE 16800ENDPROC 16810 16820DEFPROCsetcol(V%,M%,I%) 16830c%(file%,column%)=(c%(file%,column%)ANDNOT(M%<<I%))OR((V%ANDM%)<<I%) 16840ENDPROC 16850 16860DEFPROCstartdrag 16870dragreason%=-1:dragbutton%=mb%:menufile%=-1 16880PROCwtof(mh%):IFfile%>=0THEN 16890menufile%=file% 16900CASEwind%OF 16910WHEN0 16920IFNOTFNdeadfile(%1111111101011111)THEN 16930IFmb%=16dragreason%=4:PROCdragcard:ELSEmenufield%=FNmousef:IFmenufield%>0dragreason%=3:PROCdragfield 16940ENDIF 16950WHEN1 16960CASEmi%OF 16970WHEN14:IFNOTFNdeadfile(-1):menufield%=-1:dragreason%=3:PROCdragicon(mh%,mi%) 16980WHEN22:IFNOTFNdeadfile(%1111111101111111)dragreason%=1:PROCdragicon(mh%,mi%) 16990ENDCASE 17000WHEN2 17010IFNOTFNdeadfile(%11111111111111110):menusub%=FNitos:IFmenusub%>=0:dragreason%=2:PROCdragicon(mh%,mi%) 17020WHEN4 17030menufield%=my%:PROCformstat:PROCyconv(menufield%,FNv_(7),mh%) 17040dragreason%=3:PROCdragfield1 17050WHEN6:IFmi%<19:dragreason%=6:menufield%=mi%:PROCdragicon(mh%,mi%) 17060ENDCASE 17070ELSE 17080CASEmh%OF 17090WHENw_save%:IFmi%=3:dragreason%=5:PROCdragicon(w_save%,3) 17100ENDCASE 17110ENDIF 17120ENDPROC 17130 17140DEFPROCenddrag 17150PROCreadpointer:IFmenufile%>=0:PROCsdfile(menufile%) 17160IFmh%<>-1THEN 17170CASEdragreason%OF 17180WHEN1:PROCcarddr 17190WHEN2:PROCsubsdr 17200WHEN3:PROCfielddr 17210WHEN4:PROCcarddr1 17220WHEN5:PROCsavereq(FNleaf($FNia(w_save%,2)),savet%,saves%,savereason%,savefile%) 17230WHEN6:PROCnotedr 17240ENDCASE 17250ENDIF 17260dragreason%=-1:menufile%=-1 17270ENDPROC 17280 17290DEFPROCunseli(h%,i%):PROCiset(h%,i%,&200000,0) 17300DEFPROCseli(h%,i%):PROCiset(h%,i%,&200000,&200000) 17310DEFPROCshadei(h%,i%):PROCiset(h%,i%,&400000,&400000) 17320ENDPROC 17330 17340DEFPROCunselall(h%) 17350LOCALI%,i%:PROCwchi(h%) 17360I%=q%:REPEAT:i%=!I%:IFi%>=0:PROCunseli(h%,i%) 17370I%+=4:UNTILi%<0:ENDPROC 17380 17390DEFPROCwchi(h%):SYS"Wimp_WhichIcon",h%,q%,&200000,&200000 17400ENDPROC 17410 17420DEFPROCmenu 17430PROCi_init:date$=FNstrdate1(FNnow,4) 17440PROCwtof(mh%):menufile%=file%:IFfile%>=0THEN 17450CASEwind%OF 17460WHEN0:PROCcardmenu 17470WHEN1:IFmi%=7:PROCpop(m_mode%,-1):ELSEPROCcardmenu 17480WHEN2:IFNOTFNdeadfile(%11111111111111110)PROCpop(m_subs%,-1) 17490WHEN3:IFNOTFNdeadfile(%10100)PROCpop(m_report%,-1) 17500WHEN5:IFNOTFNdeadfile(%11111111101111111):PROCpop(m_index%,-1) 17510WHEN6:PROCpop(m_npad%,-1) 17520WHEN7:PROCpop(m_macro1%,-1) 17530ENDCASE 17540ELSE 17550CASEmh%OF 17560WHEN-2:my%=64+7*44:menufile%=-1:PROCpop(m_main%,-1) 17570WHENw_status%:PROCstatmenu 17580ENDCASE 17590ENDIF 17600ENDPROC 17610 17620DEFPROCcardmenu 17630IFl%(file%)<=0:IFNOTFNflg(f_pane%)ANDFNdeadfile1(%11111111101111110)PROCready:ENDPROC 17640IFl%(file%)<=0ORs%(file%)<>0ORFNv_(15)<>0:IFFNdeadfile(%11111111101111110)ENDPROC 17650PROCpop(m_card%,-1):ENDPROC 17660 17670DEFPROCstatmenu:menufile%=FNstatf:IFmenufile%<0:ENDPROC 17680PROCpop(m_status%,-1):ENDPROC 17690 17700DEFFNpar(t$,s$,RETURN i%):LOCALi1% 17710i1%=i%+1:i%=INSTR(t$+s$,s$,i1%) 17720=MID$(t$,i1%,i%-i1%) 17730 17740DEFFNcrmenu(menu$) 17750IFmenufree%+28>menuend%ERROR99,"Menu area full" 17760LOCAL m% 17770menuptr%=menufree% 17780i%=0 17790IF LEFT$(menu$,1)="#"i%=1:menutitle$=FNpar(menu$,",",i%)ELSEmenutitle$="" 17800$menuptr%=menutitle$ 17810menuptr%?12=7:menuptr%?13=2:menuptr%?14=7:menuptr%?15=0 17820menuptr%!16=196-24:menuptr%!20=44:menuptr%!24=0 17830menuptr%+=28:maxx%=LENmenutitle$ 17840REPEATitem$=FNpar(menu$,",",i%) 17850PROCmenuitem(item$) 17860UNTIL item$="" 17870m%=menufree%:m%!16=(maxx%*8+6)*2 17880menufree%=menuptr% 17890=m% 17900 17910DEFPROCmenuitem(text$) 17920IFtext$=""menuptr%!-24=(menuptr%!-24)OR&80:ENDPROC 17930IFmenuptr%+24>menuend%THENERROR99,"Menu area full" 17940LOCALi%,flg% 17950flg%=&00 17960i%=INSTR(text$,">") 17970IFi%>0subptr%=EVALMID$(text$,i%+1):text$=LEFT$(text$,i%-1)ELSEsubptr%=-1 17980i%=INSTR(text$,"}") 17990IFi%>0subptr%=EVALMID$(text$,i%+1):text$=LEFT$(text$,i%-1):flg%+=&08 18000IFRIGHT$(text$,1)="#"text$=LEFT$(text$):flg%+=&02 18010menuptr%!0=flg%:menuptr%!4=subptr%:menuptr%!8=&07000021 18020IFLEFT$(text$,1)="$"THEN 18030!menuptr%+=&04:menuptr%!8+=&100:i%=INSTR(text$,"(") 18040IFi%>0THENL%=VALMID$(text$,i%+1):text$=LEFT$(text$,i%-1)ELSEL%=12 18050menuptr%!12=EVALMID$(text$,2):menuptr%!16=-1:menuptr%!20=L% 18060text$=STRING$(L%," ") 18070ELSE 18080IFLENtext$<=12THEN 18090$(menuptr%+12)=text$ 18100ELSE 18110I%=FNworkspace(LENtext$+1):$I%=text$ 18120menuptr%!12=I%:menuptr%!16=-1:menuptr%!20=LENtext$+1 18130menuptr%!8=menuptr%!8 OR &100 18140ENDIF 18150IFLENtext$-(subptr%>0)>maxx%maxx%=LENtext$-(subptr%>0) 18160ENDIF 18170menuptr%+=24 18180ENDPROC 18190 18200DEFFNworkspace(L%) 18210IF curbuf%+L%>endbuf%ERROR99,"No more buffer space" 18220curbuf%+=L%:=curbuf%-L% 18230 18240DEFPROCprep(menu%,tree%) 18250LOCALI%,T$ 18260PROCclearts(menu%):IFmenufile%>=0:PROCsdfile(menufile%) 18270CASEmenu%OF 18280WHENm_card%:PROCmp_card 18290WHENm_format%:PROCmp_format 18300WHENm_macro%:PROCmp_macro 18310WHENm_macro1%:PROCmp_macro1 18320WHENm_default%:PROCmp_default 18330WHENm_subs%:PROCmp_subs 18340WHENm_wind%:PROCmp_wind 18350WHENm_card1%:PROCmp_card1 18360WHENm_nums%:PROCmp_nums 18370WHENm_npad%:PROCmp_npad 18380WHENm_main%:PROCmp_main 18390WHENm_status%:PROCmp_status 18400WHENm_file%:PROCmp_file 18410WHENm_report%:PROCmp_report 18420WHENm_rtype%:PROCmp_rtype 18430WHENm_rset1%:PROCmp_rset1 18440WHENm_index%:PROCmp_index 18450WHENm_mode%:PROCmp_mode 18460ENDCASE 18470ENDPROC 18480 18490DEFPROCmp_index:LOCALI%,T$ 18500IFnewmenu%:menuindex%=my%:PROCyconv(menuindex%,FNnindices,mh%) 18510IFFNnindices<=0:FORI%=0TO3:PROCshade(menu%,I%):NEXT:menuindex%=0 18520$t_iexp%="":T$="Index":IFmenuindex%>0THEN 18530SYSswi%,istat_%,menuindex%TOG%,P% 18540T$=LEFT$($sd%,12):$t_iexp%=$(sd%+16) 18550IFmenuindex%=FNcuridx:SYSswi%,istat_%,-1TOG%,P%:PROCtick(menu%,(G%AND32)>>5) 18560ENDIF 18570I%=menu%?12:$menu%=T$:menu%?12=I% 18580ENDPROC 18590 18600DEFPROCmp_mode:LOCALI% 18610FORI%=1TO6:IFINSTR(m$(file%),MID$("EDFNSC",I%,1))PROCtick(menu%,I%-1) 18620NEXT:ENDPROC 18630 18640DEFPROCmp_card 18650LOCALT%:T%=menu%+28+0*24+4 18660IFFNflg(f_pane%):PROCtick(menu%,0):!T%=-1:ELSE:!T%=w%(file%,1) 18670IFf%(file%)=0:PROCshade(menu%,1):ELSEIFf%(file%)>0:PROCtick(menu%,1) 18680IFFNmacmode:PROCtick(menu%,2) 18690IFFNdefon:PROCtick(menu%,3) 18700PROCprep(m_format%,tree%):PROCprep(m_macro%,tree%) 18710PROCprep(m_default%,tree%):PROCprep(m_wind%,tree%) 18720PROCprep(m_card1%,tree%):PROCprep(m_file%,tree%) 18730ENDPROC 18740 18750DEFPROCmp_format 18760IFf%(file%)>0:PROCtick(menu%,0) 18770ENDPROC 18780 18790DEFPROCmp_macro 18800CASEFNmacmode OF 18810WHENf_macb%:PROCtick(menu%,0) 18820WHENf_mace%:PROCtick(menu%,1) 18830ENDCASE 18840IFl%(file%)>0PROCshade(menu%,2) 18850ENDPROC 18860 18870DEFPROCmp_macro1 18880CASEFNmacmode OF 18890WHENf_macb%:PROCtick(menu%,0) 18900WHENf_mace%:PROCtick(menu%,1) 18910ENDCASE 18920IFFNdeadfile1(%1111111101111111):PROCshade(menu%,0):PROCshade(menu%,1) 18930PROCsaveset(f_mc$,&FFF,6,menufile%,80*30) 18940ENDCASE 18950ENDPROC 18960 18970DEFPROCmp_file:IFFNv_(1)<4:PROCshade(menu%,3) 18980IFFNreadonly:PROCshade(menu%,0):PROCshade(menu%,1):PROCshade(menu%,2) 18990IFl%(file%)>0PROCshade(menu%,0):PROCshade(menu%,1):PROCshade(menu%,2):PROCtick(menu%,3) 19000IFi_v%=0ORi_merging%>0:PROCshade(menu%,4) 19010ENDPROC 19020 19030DEFPROCmp_default 19040IFFNdefon:PROCtick(menu%,1) 19050IFl%(file%)>0PROCshade(menu%,0) 19060IFFNv_(15)=0PROCtick(menu%,0) 19070ENDPROC 19080 19090DEFPROCmp_wind 19100LOCALI%:FORI%=0TOmaxw%-2:IFw%(file%,I%+2)>0PROCtick(menu%,I%) 19110NEXT:ENDPROC 19120 19130DEFPROCmp_card1 19140IFFNv_(11)=0:PROCshade(menu%,1) 19150PROCsaveset(f_cd$,&FFF,1,menufile%,FNwd*FNht) 19160IFl%(file%)>0ORFNreadonly:PROCshade(menu%,0) 19170IFi_v%=0ORi_merging%>0:PROCshade(m_card1%,4) 19180ENDPROC 19190 19200DEFPROCmp_subs 19210LOCALT%:T%=FNitos:$menu%="Subsets":IFT%<256T%=T%AND31 19220CASE TRUE OF 19230WHENT%>0ANDT%<25 19240$t_subd%=d$(file%,T%-1):$menu%="Subset "+CHR$(65+T%) 19250WHENT%>255 19260PROCshade(menu%,0):PROCshade(menu%,2):PROCshade(menu%,3) 19270$menu%="Subset "+$FNia(mh%,mi%) 19280OTHERWISEFORT%=0TO3:PROCshade(menu%,T%):NEXT:T%=-1 19290ENDCASE 19300IFFNreadonly:PROCshade(menu%,2) 19310menusub%=T%:PROCprep(m_nums%,tree%) 19320ENDPROC 19330 19340DEFPROCmp_status:$menu%=FNfilename 19350SYSswi%,sd57_%,"type"TOG% 19360IFG%<>id_wcia%ANDG%<>id_bbc%ANDG%<>id_exb%:PROCshade(menu%,1):PROCshade(menu%,2):PROCshade(menu%,3) 19370SYSswi%,sd57_%,"bit7"TOG% 19380IFG%=0PROCtick(menu%,6) 19390ENDPROC 19400 19410DEFPROCmp_nums 19420IFFNnnums=10:PROCshade(menu%,0) 19430IFmenusub%<255:PROCshade(menu%,2):PROCshade(menu%,1) 19440ENDPROC 19450 19460DEFPROCmp_npad 19470PROCsaveset(f_np$,&FFF,5,menufile%,80*19) 19480ENDPROC 19490 19500DEFPROCmp_main 19510IFFNv_(1)>2:PROCshade(menu%,2):IFFNv_(1)>4:PROCshade(menu%,1) 19520ENDPROC 19530 19540DEFPROCmp_report 19550LOCALI%:IFa%(file%)<>0:FORI%=0TO3:PROCshade(menu%,I%):NEXT 19560IFs%(file%)<>0:FORI%=2TO3:PROCshade(menu%,I%):NEXT 19570IFr%(file%)=0:PROCshade(menu%,1) 19580IFr%(file%)=4:PROCshade(menu%,2) 19590IFtree%>0:IF!tree%=3:PROCsaveset(f_rx$,&FFF,7,file%,FNrsize) 19600PROCprep(m_rtype%,tree%):PROCprep(m_rset1%,tree%):ENDPROC 19610 19620DEFPROCmp_rtype:PROCtick(menu%,r%(file%)):ENDPROC 19630 19640DEFPROCmp_rset1:LOCALT$:CASEr%(file%)OF 19650WHEN3:T$=f_la$ 19660WHEN4:T$=f_wp$ 19670WHEN5:T$=f_rp$ 19680OTHERWISE:PROCshade(menu%,2) 19690ENDCASE 19700IFtree%>0:IF!tree%=1:PROCsaveset(T$,&D7B,8,file%,2000) 19710ENDPROC 19720 19730DEFPROCpop(menu%,tree%):newmenu%=TRUE 19740DEFPROCrepop(menu%,tree%):newmenu%=FALSE 19750IFprocess%>0:ENDPROC 19760IFmenu%<0:ENDPROC 19770PROCprep(menu%,tree%) 19780SYS"Wimp_CreateMenu",,menu%,mx%-50,my%+32 19790openmenu%=menu% 19800ENDPROC 19810 19820DEFPROCnomenu 19830SYS"Wimp_CreateMenu",,-1:menufile%=-1:openmenu%=-1 19840ENDPROC 19850 19860DEFPROCnodial:IFdialogue%>0PROCclosew(dialogue%) 19870ENDPROC 19880 19890DEFPROCmenuselect 19900LOCALI% 19910I%=0:REPEATmlist%!I%=q%!I%:I%+=4:UNTILq%!(I%-4)=-1 19920PROCreadpointer:IFmenufile%>=0:PROCsdfile(menufile%) 19930CASEopenmenu%OF 19940WHENm_main%:PROCm_main 19950WHENm_card%:PROCm_card 19960WHENm_subs%:PROCm_subs 19970WHENm_format%:PROCm_format 19980WHENm_npad%:PROCm_npad 19990WHENm_macro1%:PROCm_macro1 20000WHENm_status%:PROCm_status 20010WHENm_report%:PROCm_report 20020WHENm_index%:PROCm_index 20030WHENm_mode%:PROCm_mode 20040ENDCASE 20050IFmb%=1THEN 20060IFmenufile%>=0:PROCsdfile(menufile%) 20070PROCrepop(openmenu%,mlist%):ELSEPROCnomenu 20080ENDIF 20090ENDIF 20100ENDPROC 20110 20120DEFPROCm_main 20130CASE!mlist%OF 20140WHEN0:PROCdialogue(w_info%) 20150WHEN1:PROCtransfer 20160WHEN2:PROCfastsort 20170WHEN3:PROCcreate 20180WHEN4:PROCstatus 20190WHEN5:PROCpdriver 20200WHEN6:IFFNv_(1)=0:PROCquit(FALSE):ELSEPROCqquit 20210ENDCASE 20220ENDPROC 20230 20240DEFPROCm_card 20250CASE!mlist%OF 20260WHEN0:PROCswpane 20270WHEN1:PROCm_format 20280WHEN2:PROCm_macro 20290WHEN3:PROCm_default 20300WHEN4:PROCm_card1 20310WHEN5:PROCm_file 20320WHEN6:PROCm_wind 20330ENDCASE 20340ENDPROC 20350 20360DEFPROCm_mode 20370LOCALT$,I%:T$=MID$("EDFNSC",!mlist%+1,1):I%=INSTR(m$(menufile%),T$) 20380IFI%=0m$(menufile%)+=T$:ENDPROC 20390m$(menufile%)=LEFT$(m$(menufile%),I%-1)+MID$(m$(menufile%),I%+1) 20400ENDPROC 20410 20420DEFPROCm_card1 20430CASEmlist%!4OF 20440WHEN0:IFNOTFNdeadfile(-1):PROCstop(10,"Delete Card",as$,file%) 20450WHEN1:PROCrmvcard 20460WHEN2:PROCcsize 20470WHEN4:i_file%=menufile%:PROCi_send($t_impulse%,-1) 20480ENDCASE 20490ENDPROC 20500 20510DEFPROCm_macro 20520LOCALT%:T%=FNflg(f_macb%) 20530CASEmlist%!4OF 20540WHEN-1:PROCswmacro 20550WHEN0:fl%(file%)=(fl%(file%)ANDNOTf_mace%)EORf_macb%:PROCshowmac 20560WHEN1:fl%(file%)=(fl%(file%)ANDNOTf_macb%)EORf_mace%:PROCshowmac 20570WHEN2:PROCstop(22,fi$+FNfilename,rl$+"update cards ?",menufile%) 20580ENDCASE 20590IFNOTT%ANDFNflg(f_macb%):PROCvalidrec 20600ENDPROC 20610 20620DEFPROCm_macro1 20630LOCALT%,U%:T%=FNflg(f_macb%):U%=file% 20640CASE!mlist%OF 20650WHEN0:fl%(file%)=(fl%(file%)ANDNOTf_mace%)EORf_macb%:PROCshowmac 20660WHEN1:fl%(file%)=(fl%(file%)ANDNOTf_macb%)EORf_mace%:PROCshowmac 20670WHEN2:PROCstop(18,fi$+FNfilename,rl$+"clear macro ?",menufile%) 20680ENDCASE 20690PROCsdfile(U%):IFNOTT%ANDFNflg(f_macb%):PROCvalidrec 20700ENDPROC 20710 20720DEFPROCm_file 20730CASEmlist%!4OF 20740WHEN0:PROCexpr(1) 20750WHEN1:PROCinitsort 20760WHEN2:PROCstop(3,fi$+FNfilename,rl$+"compact file ?",file%) 20770WHEN3:PROCsetlink 20780WHEN4:PROCi_impulse 20790ENDCASE 20800ENDPROC 20810 20820DEFPROCm_default 20830CASEmlist%!4OF 20840WHEN-1,1:PROCswdefault 20850WHEN0:PROCshowdef 20860ENDCASE 20870ENDPROC 20880 20890DEFPROCm_wind 20900LOCALT%:T%=mlist%!4 20910IFT%>-1ANDT%<maxw%-1:IFw%(file%,T%+2)>0:PROCclosew(w%(file%,T%+2)):ENDPROC 20920CASET%OF 20930WHEN0:PROCsubs 20940WHEN1:PROCrepwind 20950WHEN2:PROCfieldlist 20960WHEN3:PROCindex 20970WHEN4:PROCnotepad 20980WHEN5:PROCmacro 20990WHEN6:PROCwtidy 21000ENDCASE 21010ENDPROC 21020 21030DEFPROCm_subs 21040CASE!mlist%OF 21050WHEN0:PROCstop(4,FNsubdesc1(menusub%),rl$+"fill subset ?",file%) 21060WHEN1:PROCstop(5,FNsubdesc1(menusub%),rl$+"clear subset ?",file%) 21070WHEN2:PROCstop(15,FNsubdesc1(menusub%),rl$+"destroy subset ?",file%) 21080WHEN3:d$(file%,(menusub%AND31)-1)=$t_subd% 21090WHEN4 21100CASEmlist%!4OF 21110WHEN0:PROCnumeric(0) 21120WHEN1:PROCnumeric(1) 21130WHEN2:PROCstop(8,FNsubdesc1(menusub%),rl$+" delete subset ?",file%) 21140ENDCASE 21150ENDCASE 21160ENDPROC 21170 21180DEFPROCm_status:LOCALf%,T%:f%=TRUE:PROCsdfile(menufile%) 21190CASE!mlist%OF 21200WHEN0:PROCnodial:PROCwalign 21210WHEN1:PROCreadws:PROCnewnotes 21220WHEN2:PROCwritews 21230WHEN3 21240T%=FNhdbyte(&35):IFT%=id_wcia%ORT%=id_bbc%ORINKEY-3THEN 21250SYSswi%,sd14_%,id_exb%,&35 21260PROCwritews 21270ENDIF 21280WHEN4:SYSswi%,sd43_% 21290WHEN5:PROCgetpass:f%=FALSE 21300WHEN6:PROCswap7 21310OTHERWISEf%=FALSE 21320ENDCASE 21330IFf%:PROCnodial 21340ENDPROC 21350 21360DEFPROCm_format 21370CASEmlist%!4OF 21380WHEN-1,0:PROClink 21390WHEN1:PROCcloseform 21400ENDCASE 21410ENDPROC 21420 21430DEFPROCm_npad 21440CASE!mlist%OF 21450WHEN0:PROCstop(17,fi$+FNfilename,rl$+"clear notepad ?",menufile%) 21460WHEN2:PROCnewnotes 21470ENDCASE 21480ENDPROC 21490 21500DEFPROCm_report 21510CASE!mlist%OF 21520WHEN0:IFmlist%!4>=0r%(file%)=mlist%!4:PROCmakerep(file%) 21530WHEN1 21540CASEmlist%!4OF 21550WHEN0,-1:PROCrsetup 21560WHEN1:PROCclearrep 21570ENDCASE 21580WHEN2:PROCprintrep 21590ENDCASE:ENDPROC 21600 21610DEFPROCm_index:IFFNdeadfile(-1):ENDPROC 21620CASE!mlist%OF 21630WHEN0,1:PROCselindex(menuindex%,!mlist%) 21640WHEN2:PROCselindex(0,0) 21650ENDCASE 21660ENDPROC 21670 21680DEFPROCsubmenu(menu%,X%,Y%,q%) 21690LOCALI% 21700I%=0:REPEATmlist%!I%=q%!I%:I%+=4:UNTILq%!(I%-4)=-1 21710PROCprep(openmenu%,mlist%) 21720SYS"Wimp_CreateSubMenu",,menu%,X%,Y% 21730ENDPROC 21740 21750DEFPROCclearts(mh%):LOCALI%:I%=mh%+28 21760IFmh%<menustart%ORmh%>menuend%:ENDPROC 21770REPEAT 21780!I%=!I%ANDNOT1:I%!8=I%!8ANDNOT&400000: 21790I%+=24:UNTILI%!-24AND&80 21800ENDPROC 21810 21820DEFPROCshade(mh%,I%) 21830mh%!(28+8+24*I%)=mh%!(28+8+24*I%)OR&400000:ENDPROC 21840 21850DEFPROCtick(mh%,I%) 21860mh%!(28+24*I%)=mh%!(28+24*I%)OR&01:ENDPROC 21870 21880DEFPROCredraw(update%) 21890LOCALh%,T%:IFupdate%THEN 21900SYS"Wimp_UpdateWindow",,q% TO more% 21910ELSE 21920SYS"Wimp_RedrawWindow",,q% TO more% 21930ENDIF 21940h%=!q%:PROCwtof(h%):PROCreadblock(q%+4) 21950WHILE more% 21960T%=FALSE:LOCALERROR:ONERRORLOCAL:T%=TRUE 21970IFT%THEN 21980IFINKEY-3:PROCrectfill(REPORT$):ELSERESTOREERROR:PROCerr(0) 21990ELSE 22000IFfile%>=0THEN 22010CASEwind%OF 22020WHEN0:PROCdrawcard 22030WHEN3:PROCdrawrep 22040WHEN4:PROCdrawflist 22050WHEN5:PROCdrawilist 22060ENDCASE 22070ELSE 22080ENDIF 22090ENDIF 22100RESTOREERROR 22110!q%=h%:more%=FNnextrectangle 22120ENDWHILE 22130ENDPROC 22140 22150DEFPROCdrawcard 22160CASEs%(file%)OF 22170WHEN0 22180LOCALT%:IFupdate%ANDNOT(pix%ANDFNflg(f_pics%))THEN 22190T%=6 22200ELSE 22210SYSswi%,gline_%:CLG:T%=2 22220ENDIF 22230PROCgcol(0,7+lc%*(l%(file%)>0)):PROCgcol(0,130+NOTFNflg(f_7bit%)) 22240MOVEbx%+margin%,by%-margin%:SYSswi%,wimp_%,T%,sdf$ 22250PROCpix 22260WHEN1:PROCrectfill("No cards in this subset") 22270WHEN2:PROCrectfill(FNactdesc) 22280ENDCASE 22290ENDPROC 22300 22310DEFPROCdrawflist:LOCALT%:T%=&10000:IFupdate%T%=T%OR1 22320IFFNv_(7)=0PROCrectfill("No fields in this file"):ENDPROC 22330MOVEbx%+margin%,by%-margin%-4:SYSswi%,wimp_%,T%,sd$ 22340ENDPROC 22350 22360DEFPROCdrawilist:LOCALT%,x%,y%,X%,Y%:T%=&20000:IFupdate%T%=T%OR1 22370IFFNnindices=0PROCrectfill("No indices in this file"):ENDPROC 22380MOVEbx%+margin%,by%-margin%-4:SYSswi%,wimp_%,T%,sdf$ 22390T%=FNcuridx:IFT%>0THEN 22400X%=bx%:Y%=by%-margin%-T%*linegap%:y%=Y%+linegap%+3:x%=X%+5000 22410IFX%<gx0%X%=gx0% 22420IFx%>gx1%x%=gx1%-1 22430IFY%<gy0%Y%=gy0% 22440IFy%>gy1%y%=gy1%-1 22450IFy%>=Y%ANDx%>=X%VDU24,X%;Y%;x%;y%;:PROCgcol(0,128+7):PROCgcol(0,1):MOVEbx%+margin%,by%-margin%-4:SYSswi%,wimp_%,&20001 22460ENDIF 22470ENDPROC 22480 22490DEFPROCdrawrep:IFupdate%CLG 22500IFs%(file%)=2THEN 22510PROCrectfill(FNactdesc) 22520ELSE 22530CASEr%(file%)OF 22540WHEN0:PROCdrawcards 22550WHEN1:PROCdrawsheet 22560WHEN2:PROCdrawformula 22570WHEN3:PROCdrawlabels 22580WHEN4:PROCdrawwordpro 22590WHEN5:PROCdrawpaged 22600ENDCASE 22610ENDIF 22620ENDPROC 22630 22640DEFPROCdrawcards:LOCALh%,T%,d%,t%,e%:d%=FNv_(14):IFupdate%:t%=1 22650IFupdate%:t%=6:ELSEt%=2 22660LOCALERROR 22670ONERRORLOCAL:RESTOREERROR:PROCrepdrawn(d%):PROCforcerep:PROCerr(0) 22680h%=FNrht:T%=(by%-gy1%-margin%-4)/(linegap%*h%) 22690Y%=by%-margin%-h%*linegap%*T%:REPEAT:SYSswi%,grec_%,T%+1TON% 22700PROCsd35:CASEG%OF 22710WHEN0 22720PROCgcol(0,7+lc%*(l%(file%)>0)):PROCgcol(0,130+NOTFNflg(f_7bit%)) 22730MOVEbx%+margin%,Y%:SYSswi%,wimp_%,t%,sd$ 22740WHEN1:PROCprintcard("Card "+STR$FNv_(15)+" not in this subset",Y%,h%+(h%>1)) 22750WHEN128:PROCprintcard("Deleted card number "+STR$FNv_(15),Y%,h%+(h%>1)) 22760ENDCASE:Y%-=h%*linegap%:T%+=1 22770IFh%>1MOVEgx0%,Y%+4+linegap%DIV2:PROCgcol(0,2):DRAWBYgx1%-gx0%,0 22780UNTILY%<gy0%ORT%>FNv_(17):PROCrepdrawn(d%):ENDPROC 22790 22800DEFPROCdrawsheet:LOCALY%,T%,d%:d%=FNv_(14) 22810LOCALERROR 22820ONERRORLOCAL:RESTOREERROR:PROCrepdrawn(d%):PROCforcerep:PROCerr(0) 22830T%=(by%-gy1%-margin%-4)DIVlinegap%:Y%=by%-margin%-linegap%*T% 22840IFgx0%<bx%+margin%+16*(12+LENFNsrep(1))THEN 22850WHILEY%>=gy0%ANDT%<=FNv_(17)+3:PROCgcol(0,7+lc%*(l%(file%)>0)) 22860MOVEbx%+margin%,Y% 22870PRINTFNslin(T%+1) 22880T%+=1:Y%-=linegap%:ENDWHILE 22890ENDIF:PROCrepdrawn(d%):ENDPROC 22900 22910DEFPROCdrawformula:LOCALY%,rec%,d%,L%:d%=FNv_(14):L%=(gx1%-bx%-margin%)DIV16+1 22920LOCALERROR 22930ONERRORLOCAL:RESTOREERROR:PROCrepdrawn(d%):PROCforcerep:PROCerr(0) 22940rec%=(by%-gy1%-margin%-4)DIVlinegap%:Y%=by%-margin%-linegap%*rec% 22950WHILEY%>=gy0%ANDrec%<FNv_(17):PROCgcol(0,7+lc%*(l%(file%)>0)):MOVEbx%+margin%,Y% 22960PRINTFNrlin(rec%+1,L%) 22970rec%+=1:Y%-=linegap%:ENDWHILE:PROCrepdrawn(d%):ENDPROC 22980 22990DEFPROCdrawpaged:LOCALY%,T%,L%,A%,B%,T$:L%=p%(file%,2) 23000A%=(gx0%-bx%-margin%)DIV16+1:B%=(gx1%-bx%-margin%)DIV16+1 23010T%=(by%-gy1%-margin%-4)DIVlinegap%:Y%=by%-margin%-linegap%*T% 23020WHILEY%>=gy0%:MOVEbx%+margin%,Y% 23030CASET%OF 23040WHEN0:PRINTFNtopline; 23050WHEN1,2,3:T$=LEFT$(p$(file%,T%),L%):PRINTSPC((L%-LENT$)/2)T$; 23060WHEN4:PRINTFNdummyhdrs(B%); 23070WHEN5:PRINTFNdummydsh(B%,"-",TRUE); 23080WHEN6,7,8:PRINTFNdummycols(A%,B%,TRUE); 23090WHEN9:PRINTFNdummydsh(B%,"-",FALSE); 23100WHEN10:PRINTFNdummycols(A%,B%,FALSE); 23110WHEN11:PRINTFNdummydsh(B%,"=",FALSE); 23120WHEN13:IFFNflg(f_rbpn%):IFL%>7PRINTSPC((L%-8)/2)"Page ###"; 23130ENDCASE 23140T%+=1:Y%-=linegap%:ENDWHILE 23150ENDPROC 23160 23170DEFPROCrepdrawn(d%):SYSswi%,locate_%,d%TOD% 23180PROCrlink(FALSE):ENDPROC 23190 23200DEFPROCdrawlabels:LOCALY%,T% 23210T%=(by%-gy1%-margin%-4)DIVlinegap%:Y%=by%-margin%-linegap%*T% 23220WHILEY%>=gy0%ANDT%<ll%(file%,3):MOVEbx%+margin%,Y% 23230PROCgcol(0,7+lc%*(l%(file%)>0)) 23240PRINTFNdumlab(T%):T%+=1:Y%-=linegap%:ENDWHILE:ENDPROC 23250 23260DEFPROCdrawwordpro:LOCALY%,T% 23270T%=(by%-gy1%-margin%-4)DIVlinegap%:Y%=by%-margin%-linegap%*T% 23280WHILEY%>=gy0%ANDT%<15:MOVEbx%+margin%,Y%:PROCgcol(0,7+lc%*(l%(file%)>0)) 23290PRINTFNwlin(T%) 23300T%+=1:Y%-=linegap%:ENDWHILE:ENDPROC 23310 23320DEFFNnextrectangle:LOCALT%:SYS"Wimp_GetRectangle",,q%TOT% 23330PROCreadblock(q%+4):=T% 23340 23350DEFPROCrectfill(T$) 23360PROCgcol(0,3):LOCALI%,J%,L%,X%,Y% 23370L%=LENT$*16+48 23380X%=bx%+margin%:J%=gx0%-X%:X%=X%-J%+J%MODL% 23390J%=by%-gy1%-margin%:J%=J%-J%MODlinegap%:Y%=by%-margin%-4-J% 23400FORJ%=Y%TOgy0%STEP-linegap% 23410MOVEX%,J%:FORI%=X%TOgx1%STEPL%:PRINTT$" - ";:NEXT 23420NEXT:ENDPROC 23430 23440DEFPROCprintcard(T$,Y%,h%) 23450PROCgcol(0,3):LOCALI%,J%,L%,X% 23460L%=LENT$*16+48:J%=ABS(Y%-gy0%)DIVlinegap%+1:IFh%>J%h%=J% 23470X%=bx%+margin%:J%=gx0%-X%:X%=X%-J%+J%MODL% 23480FORJ%=Y%TOY%-h%*linegap%+1STEP-linegap% 23490MOVEX%,J%:FORI%=X%TOgx1%STEPL%:PRINTT$" - ";:NEXT 23500NEXT:ENDPROC 23510 23520DEFFNinbox(X%,Y%,W%,H%) 23530IFW%<0:X%+=W%:W%=-W% 23540IFH%<0:Y%+=H%:H%=-H% 23550IFgx0%>X%+W%:=FALSE 23560IFgx1%<X%:=FALSE 23570IFgy0%>Y%+H%:=FALSE 23580IFgy1%<Y%:=FALSE 23590=TRUE 23600 23610DEFPROCwaitpoint 23620waiter%+=1 23630SYS"Hourglass_On" 23640ENDPROC 23650 23660DEFPROCnormpoint 23670WHILEwaiter%>0:SYS"Hourglass_Off":waiter%-=1:ENDWHILE:waiter%=0 23680ENDPROC 23690 23700DEFPROCgcol(m%,c%) 23710SYS"Wimp_SetColour",(m%<<4)+c% 23720ENDPROC 23730 23740DEFPROCdataloadack 23750!q%=20:q%!12=ref%:q%!16=4 23760SYS"Wimp_SendMessage",17,q%,task% 23770ENDPROC 23780 23790DEFPROCdatasaveack 23800IFFNArfVar("Wimp$Scrap")="":ERROR99,"<Wimp$Scrap> not defined" 23810!q%=60:q%!12=ref%:q%!16=2:q%!36=-1:$(q%+44)="<Wimp$Scrap>"+CHR$0 23820SYS"Wimp_SendMessage",17,q%,task%:ackref%=q%!8 23830ENDPROC 23840 23850DEFPROCsavereq(T$,t%,s%,r%,f%) 23860savereason%=r%:savefile%=f% 23870q%!32=my%:q%!28=mx%:q%!24=mi%:q%!20=mh% 23880q%!16=1:q%!12=0:q%!36=s%:q%!40=t%:!q%=(LENT$+49)AND&FFFC 23890$(q%+44)=T$+CHR$0:SYS"Wimp_SendMessage",17,q%,mh%,mi% 23900saveref%=q%!8:savetype%=t%:ENDPROC 23910 23920DEFPROCloadmess:PROCreadpointer:IFtask%<0ENDPROC 23930$(q%+44)=file$+CHR$0:!q%=(LENfile$+49)AND&FFFC 23940q%!12=ref%:q%!16=3:q%!40=savetype% 23950q%!20=mh%:q%!24=mi%:q%!28=mx%:q%!32=my%:q%!36=FNfsize(file$) 23960SYS"Wimp_SendMessage",17,q%,task% 23970ackpending%=TRUE:ENDPROC 23980 23990DEFFNfsize(T$):LOCALT%,s%:T%=OPENINT$:IFT%=0:=0 24000s%=EXT#T%:CLOSE#T%:=s% 24010 24020DEFFNzts(T%):LOCALT$ 24030WHILE?T%<>0:T$+=CHR$?T%:T%+=1:ENDWHILE 24040=T$ 24050 24060DEFPROCkey(h%,icon%,x%,y%,carh%,off%,key%) 24070PROCwtof(h%) 24080IFfile%>=0ANDwind%=0ANDfile%=edfile%:PROCedkey:ENDPROC 24090IFfile%>=0ANDwind%=3ANDfile%=edfile%:PROCedkeyr:ENDPROC 24100LOCALF%:F%=TRUE 24110CASEkey%OF 24120WHEN9,&18A:PROCfindct 24130WHEN13:PROCcursor(h%,icon%,1,0) 24140WHEN19:PROCswapcase 24150WHEN27:IFdialogue%>=0PROCnodial:ELSEF%=FALSE 24160WHEN&18F:PROCcursor(h%,icon%,-1,off%) 24170WHEN&18E:PROCcursor(h%,icon%,1,off%) 24180WHEN&19F:PROCcursor(h%,icon%,-5,off%) 24190WHEN&19E:PROCcursor(h%,icon%,5,off%) 24200WHEN&1AF,30:PROCcursor(h%,icon%,-1E9,off%) 24210WHEN&1AE:PROCcursor(h%,icon%,1E9,off%) 24220OTHERWISEF%=FALSE 24230ENDCASE 24240IFF%:ENDPROC 24250SYS"Wimp_ProcessKey",key% 24260ENDPROC 24270 24280DEFPROCedkey 24290LOCALT%,t%:T%=edfield%:PROCformstat 24300IFFNv_(7)=edfield%ANDkey%=13:PROCendedit:ENDPROC 24310t%=0:CASEkey%OF 24320WHEN27:PROCseti(w%(file%,0),edicon%,FNgfield(edfield%)):PROCendedit 24330WHEN19:PROCswapcase 24340WHEN1:PROCadd 24350WHEN9,&18A:PROCfindct 24360WHEN&18F:t%=-1 24370WHEN&18E,13:t%=1 24380WHEN&19F:t%=-5 24390WHEN&19E:t%=5 24400WHEN&1AF,30:T%=0:t%=1 24410WHEN&1AE:T%=FNv_(7)+1:t%=-1 24420OTHERWISE:SYS"Wimp_ProcessKey",key% 24430ENDCASE:IFt%PROCfedit2(T%,t%) 24440ENDPROC 24450 24460DEFPROCedkeyr 24470LOCALT%,X%,r%,I% 24480RESTORE+1:REPEAT:READX%:I%=I%OR(X%=key%):UNTILX%=-1 24490DATA13,&18F,&1BF,&18E,&1BE,&1BC,&1BD,&1AF,&1AE,-1 24500T%=edfield%:X%=edx%:r%=edrec%:SYSswi%,grec_%,r%TON% 24510IFI%:PROCsetedfield1:r%=FNv_(15):edrec%=r% 24520CASEkey%OF 24530WHEN27:X%=-1:PROCseti(w%(file%,3),edicon%,FNgfield(edfield%)):PROCendedit 24540WHEN19:PROCswapcase:X%=-1 24550WHEN9,&18A:PROCfindct:X%=-1 24560WHEN13:SYSswi%,dir_%,1 24570PROCsrxnext(X%,T%,1):IFX%=1PROCsdnext 24580WHEN&18F,&1BF:SYSswi%,dir_%,0 24590PROCsdnext 24600WHEN&18E,&1BE:SYSswi%,dir_%,1 24610PROCsdnext 24620WHEN&1BC:PROCsrxnext(X%,T%,-1) 24630WHEN&1BD:PROCsrxnext(X%,T%,1) 24640WHEN&1AF:SYSswi%,first_%TO,N% 24650PROCsdnext 24660WHEN&1AE:SYSswi%,grec_%,FNv_(17)TON% 24670SYSswi%,dir_%,0 24680PROCsd35:IFG%:PROCsdnext 24690OTHERWISE:X%=-1:SYS"Wimp_ProcessKey",key% 24700ENDCASE 24710IFFNbadrec(FNv_(15)):PROCvalidrec1 24720IFs%(file%)<>0:PROCendedit:X%=-1 24730IFX%>0PROCedrep(X%,FNv_(15)) 24740IFFNv_(15)<>r%:PROCvalidrec1 24750ENDPROC 24760 24770DEFPROCswapcase:PROCgetct:T%=q%!20+FNia(!q%,q%!4) 24780IF?T%<123AND?T%>96 ?T%-=32:ELSEIF?T%<91AND?T%>64 ?T%+=32 24790PROCgetct:IF?T%>31PROCsetct(!q%,q%!4,q%!20+1) 24800PROCgetct:PROCiconupd(!q%,q%!4):ENDPROC 24810 24820DEFPROCgetct:SYS"Wimp_GetCaretPosition",,q%:ENDPROC 24830 24840DEFPROCsetct(h%,i%,o%) 24850SYS"Wimp_SetCaretPosition",h%,i%,,,-1,o% 24860IFi%>=0PROCfindct 24870ENDPROC 24880 24890DEFFNnumi(h%,i%,b%) 24900RESTORE25070 24910LOCALU%,D%,N%,T%,B%,W%,F%,S%,V% 24920WHILEW%<>-1ANDF%=FALSE 24930PROCreadh(W%):READU%,D%,N%,T%,B% 24940IFW%=h%THEN 24950IFi%=U%ORi%=D%THEN 24960F%=TRUE 24970V%=VAL$FNia(W%,N%) 24980S%=1:IFi%=D%:S%=-1 24990IFb%=1:S%=S%*10 25000V%+=S%:IFV%<B%:V%=B% 25010IFV%>T%V%=T% 25020PROCseti(W%,N%,STR$V%) 25030ENDIF 25040ENDIF 25050ENDWHILE 25060=F% 25070DATAw_finf%,3,4,2,255,1 25080DATAw_finf%,18,21,20,255,1 25090DATAw_finf%,14,15,13,6,1 25100DATAw_label%,10,13,12,99,1 25110DATAw_label%,5,7,41,99,1 25120DATAw_label%,42,4,23,99,1 25130DATAw_label%,14,16,6,99,1 25140DATAw_label%,18,20,15,maxacr%,1 25150DATAw_label%,22,24,19,99,1 25160DATAw_label%,47,49,48,20,0 25170DATAw_label%,51,53,52,99,0 25180DATAw_rset3%,8,9,7,255,10 25190DATAw_rset3%,11,13,12,99,0 25200DATAw_rset3%,15,17,16,255,1 25210DATAw_rset3%,27,25,26,99,6 25220DATAw_rset3%,21,23,22,99,6 25230DATAw_col%,13,14,10,200,1 25240DATAw_col%,18,20,19,6,0 25250DATAw_csize%,56,58,57,255,1 25260DATAw_csize%,60,62,61,255,1 25270DATA-1,-1,-1,-1,-1,-1,-1 25280 25290DEFPROCcursor(h%,i%,s%,o%) 25300RESTORE25490 25310LOCALW%,T$,I% 25320WHILEW%<>-1 25330PROCreadh(W%):IFW%<>h%THEN 25340IFW%<>-1:REPEAT:READW%:UNTILW%<-1:W%=0 25350ELSE 25360REPEAT 25370READW%:IFW%<>-1:T$+=CHR$(W%) 25380UNTILW%<-1:T$=LEFT$(T$) 25390IFkey%=13:IFASCRIGHT$(T$)=i%:mi%=ABS(W%+100):mb%=1:mh%=h%:PROCselect:ENDPROC 25400IFs%=1E9:s%=LENT$:ELSEIFs%=-1E9:s%=1:ELSEs%+=INSTR(T$,CHR$i%) 25410WHILEs%>LENT$:s%-=LENT$:ENDWHILE 25420WHILEs%<1:s%+=LENT$:ENDWHILE 25430I%=ASCMID$(T$,s%) 25440IFo%>LEN$FNia(h%,I%)o%=LEN$FNia(h%,I%) 25450PROCsetct(h%,I%,o%) 25460ENDIF 25470ENDWHILE 25480ENDPROC 25490DATAw_expr%,17,exi0%,-123 25500DATAw_nums%,2,3,-105 25510DATAw_finf%,5,exi0%,13,exi1%,-119 25520DATAw_rlink%,1,3,5,-108 25530DATAw_srset%,3,-106 25540DATAw_label%,48,12,41,23,6,52,15,19,-128 25550DATAw_open%,14,-112 25560DATAw_passw%,5,1,2,-103 25570DATAw_word%,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,-142 25580DATAw_sort%,2,-106 25590DATAw_pdrive%,7,8,9,10,11,12,13,-118 25600DATAw_rset1%,1,2,3,4,-105 25610DATAw_rset2%,42,43,44,45,-100 25620DATAw_rset3%,7,12,16,26,22,-100 25630DATAw_col%,22,24,10,19,-142 25640DATAw_csize%,61,57,-164 25650DATAw_impulse%,11,12,14,15,16,17,18,9,-107 25660DATAw_save%,2,-100 25670DATA"w%(file%,1)",7,-105 25680DATA"w%(file%,6)",0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,-100 25690DATA"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 25700DATA-1 25710 25720DEFPROCreadh(RETURN T%) 25730LOCALT$:READT$:IFfile%<0ANDINSTR(T$,"file%")T%=1:ELSET%=EVALT$ 25740ENDPROC 25750 25760DEFFNleaf(T$) 25770LOCALI%,C% 25780IF((INSTR(T$,".")=0)AND(INSTR(T$,":")=0))THEN=T$ 25790I%=LEN(T$) 25800REPEAT 25810C%=ASCMID$(T$,I%,1) 25820I%-=1 25830UNTIL(I%<=0ORC%=ASC"."ORC%=ASC":") 25840IFI%>0THEN=RIGHT$(T$,LEN(T$)-I%-1) 25850=T$ 25860 25870DEFPROCwext(h%,x%,y%):!q%=0:q%!4=-y%:q%!8=x%:q%!12=0 25880SYS"Wimp_SetExtent",h%,q%:PROCforce(h%) 25890PROCgetw(h%):IFopen%THEN 25900IFx1%-x0%>x%:x%+=x0%:ELSEx%=x1% 25910IFy1%-y0%>y%:y%=y1%-y%:ELSEy%=y0% 25920PROCopen(h%,x0%,y%,x%,y1%,scx%,scy%,bhandle%) 25930ENDIF 25940ENDPROC 25950 25960DEFPROCprocess 25970IFdialreason%>=0ORdialogue%>=0ORackpending%>0ENDPROC 25980CASEprocess%OF 25990WHEN1:PROCcheckprot 26000WHEN2:PROCstop(1,"Please place original","MultiStore disk in drive :0",-1):process%+=1 26010WHEN3:PROCcheckprot 26020WHEN4:PROCstartopen 26030OTHERWISEprocess%=0:PROCnewdelay 26040ENDCASE 26050ENDPROC 26060 26070DEFPROCdragicon(h%,i%) 26080LOCALx%,y%,ys%,tx0%,ty0%,tx1%,ty1% 26090PROCgetw(h%):ys%=y1%-y0%:x%=bx%:y%=y0%-scy% 26100PROCgeti(h%,i%):q%!8+=x%:q%!12+=y%+ys%:q%!16+=x% 26110q%!20+=y%+ys%:q%!24=0:q%!28=0:!q%=0:PROCdrag5:ENDPROC 26120 26130DEFPROCdrag5:PROCreadpointer:PROCscrsz:tx0%=mx%-q%!8:ty0%=my%-q%!12 26140q%!24-=tx0%:q%!28-=ty0%:q%!32+=q%!16-mx%:q%!36+=q%!20-my% 26150q%!4=5:SYS"Wimp_DragBox",,q%:ENDPROC 26160 26170DEFFNlower(T$):IFT$="":="" 26180LOCALI%,C% 26190FORI%=1TOLENT$:C%=ASCMID$(T$,I%) 26200IFC%>64ANDC%<91MID$(T$,I%,1)=CHR$(C%+32) 26210NEXT:=T$ 26220 26230DEFPROCwtof(T%) 26240LOCALI%,J% 26250wind%=-1:file%=-1 26260FORI%=0TOmaxf% 26270FORJ%=0TOmaxw% 26280IFw%(I%,J%)=T%:file%=I%:wind%=J%:PROCsdfile(file%):ENDPROC 26290NEXT 26300NEXT:ENDPROC 26310 26320DEFFNformhand(T%):IFf%(T%)>0:=f%(T%):ELSE=h%(T%) 26330 26340DEFPROCfext 26350LOCALx%,y% 26360y%=FNht*linegap%+margin%*2:IFy%<paneh%y%=paneh% 26370x%=FNwd*16+margin%*2:IFx%<22*16x%=22*16 26380PROCwext(w%(file%,0),x%,y%):ENDPROC 26390 26400DEFPROCrext:IFw%(file%,3)<=0ENDPROC 26410LOCALX%,Y%:CASEr%(file%)OF 26420WHEN0:X%=FNwd:Y%=FNint(FNrht*FNv_(17)) 26430WHEN1:X%=255:Y%=FNv_(17)+4 26440WHEN2:X%=255:Y%=FNv_(17) 26450WHEN3:Y%=ll%(file%,3):X%=FNlwidth 26460WHEN4,5:X%=255:Y%=15 26470ENDCASE 26480IFX%<24X%=24 26490PROCwext(w%(file%,3),X%*16+margin%*2,Y%*linegap%+margin%*2) 26500ENDPROC 26510 26520DEFFNrht:LOCALT%:T%=FNht:=T%-(T%>1) 26530DEFFNht:SYSswi%,sd57_%,"height",sd$TOG% 26540DEFFNwd:SYSswi%,sd57_%,"width",sd$TOG% 26550PROCsdfile(file%):=G% 26560 26570DEFFNint(t):IFABSt>2E9:=SGNt*2E9:ELSE=t 26580 26590DEFPROCsdfile(T%) 26600LOCALG%:file%=T%:sd$=STR$FNformhand(T%):sdf$=STR$h%(T%) 26610SYSswi%,file_%,sdf$:SYSswi%,sd13_% 26620ENDPROC 26630 26640DEFPROCformstat:SYSswi%,sd13_%,0,sd$TOG% 26650ENDPROC 26660 26670DEFFNbadrec(T%):=(T%AND&7FFFFF00)=&7FFFFF00 26680 26690DEFPROCvalidrec1:PROCvr(FALSE,TRUE) 26700DEFPROCvalidrec2:PROCvr(TRUE,FALSE) 26710DEFPROCvalidrec:PROCvr(TRUE,TRUE) 26720ENDPROC 26730 26740DEFPROCvr(T%,U%) 26750PROCsd35:IFG%:IFNOTFNokcard:PROCnewcard(T%,U%):ENDPROC 26760REPEAT 26770IFFNflg(f_macb%)THEN 26780PROCbmacro:PROCsd35:IFG%THEN 26790IFNOTFNokcard:PROCnewcard(T%,U%):ENDPROC:ELSEG%=-1 26800ENDIF 26810ENDIF 26820UNTILG%=0 26830PROCnewcard(T%,U%) 26840ENDPROC 26850 26860DEFPROCvalidaterec:PROCvrr(TRUE):ENDPROC 26870DEFPROCvalidaterec1:PROCvrr(FALSE):ENDPROC 26880 26890DEFPROCvrr(T%):PROCsd35:IFG%=0:ENDPROC 26900PROCvr(T%,TRUE):ENDPROC 26910 26920DEFPROCrevalidate 26930IFs%(file%)=1s%(file%)=0:PROCvalidrec2:ELSEPROCvalidaterec 26940PROCforcerep:ENDPROC 26950 26960DEFFNokcard 26970LOCALg% 26980LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCchecksubset:PROCerr(32) 26990*fx229 27000REPEAT 27010PROCvalidr1 27020IFFNbadrec(FNv_(15))g%=0:ELSEPROCsd35:g%=G%:IFG%:PROCsdnext 27030UNTILg%=0:*fx229,1 27040=NOT(FNbadrec(FNv_(15))ANDFNbadrec(FNv_(14))) 27050 27060DEFPROCvalidr1 27070D%=FNv_(14):N%=FNv_(15) 27080IFD%=0ORN%=0THEN 27090SYSswi%,first_%TO,N% 27100PROCsdnext:D%=FNv_(14):N%=FNv_(15) 27110ENDIF 27120IFNOTFNbadrec(D%):ENDPROC 27130IFFNbadrec(N%)THEN 27140CASE N%AND1 OF 27150WHEN 1 27160SYSswi%,first_%TO,N% 27170PROCsdnext:D%=FNv_(14):N%=FNv_(15) 27180WHEN 0 27190SYSswi%,grec_%,FNv_(17)TON% 27200SYSswi%,dir_%,0 27210PROCsd35:IFG%PROCsdnext 27220D%=FNv_(14):N%=FNv_(15) 27230ENDCASE 27240IFNOTFNbadrec(N%):SYSswi%,sd30_%,N%TOG%:D%=FNv_(14) 27250ELSE 27260IFN%>FNv_(17)THEN 27270SYSswi%,first_%TO,N% 27280PROCsdnext:D%=FNv_(14):N%=FNv_(15) 27290ELSE 27300SYSswi%,sd30_%,N%TOG% 27310ENDIF 27320ENDIF 27330ENDPROC 27340 27350DEFPROCsd35 27360D%=FNv_(14):N%=FNv_(15) 27370IFN%=0ORD%=0:G%=1:ENDPROC 27380IFFNbadrec(N%)THEN 27390IFFNbadrec(D%):G%=1:ELSEG%=0 27400ELSE 27410SYSswi%,sd35_%,N%TOG% 27420IFG%=0G%=FNfilter 27430ENDIF 27440ENDPROC 27450 27460DEFFNfilter:PROCrlink(FALSE):IFNOTFNflg(f_filt%):=0 27470LOCALERROR 27480ONERRORLOCAL:RESTOREERROR:PROCnofilt:PROCerr(8) 27490IFFNev(fx$(file%),FNflg(f_fspc%),FNflg(f_fupp%)):=0:ELSE=1 27500 27510DEFPROCsdnext 27520SYSswi%,sd23_%TON% 27530LOCALERROR:ONERRORLOCAL:RESTOREERROR:IFERR=17:G%=0:ENDPROC:ELSEPROCerr(0) 27540*fx229 27550REPEAT 27560SYSswi%,next_%TON% 27570IFFNbadrec(N%)G%=0:ELSEPROCsd35 27580UNTILG%=0 27590*fx229,1 27600ENDPROC 27610 27620DEFPROCfwd:IFFNdeadfile(-1):ENDPROC 27630LOCALn%:SYSswi%,sd23_%TON% 27640SYSswi%,dir_%,1 27650n%=N%:PROCsdnext:IFFNbadrec(FNv_(15)):SYSswi%,grec_%,n%TON% 27660IFn%<>FNv_(15)PROCvalidrec 27670ENDPROC 27680 27690DEFPROCffwd:IFFNdeadfile(-1):ENDPROC 27700a%(file%)=1:PROCnewdelay 27710ENDPROC 27720 27730DEFPROCfback:IFFNdeadfile(-1):ENDPROC 27740a%(file%)=2:PROCnewdelay:PROCmatchrep 27750ENDPROC 27760 27770DEFPROCskip(d%) 27780LOCALT%,t%:t%=a%(file%):SYSswi%,dir_%,d% 27790T%=FNv_(15):PROCsdnext:PROCvalidrec 27800a%(file%)=t%:IFT%<>FNv_(15):PROCnewdelay:ELSEPROCready 27810ENDPROC 27820 27830DEFPROCback:IFFNdeadfile(-1):ENDPROC 27840LOCALn%:SYSswi%,sd23_%TON% 27850SYSswi%,dir_%,0 27860n%=FNv_(15):PROCsdnext:IFFNbadrec(FNv_(15)):SYSswi%,grec_%,n% 27870IFn%<>FNv_(15):PROCvalidrec 27880ENDPROC 27890 27900DEFPROCbof:IFFNdeadfile(-1):ENDPROC 27910SYSswi%,first_% 27920PROCsdnext:PROCvalidrec:ENDPROC 27930 27940DEFPROCpause:PROCready:ENDPROC 27950 27960DEFPROCeof:IFFNdeadfile(-1):ENDPROC 27970SYSswi%,grec_%,FNv_(17) 27980PROCvalidrec:ENDPROC 27990 28000DEFPROCcardnum:IFFNdeadfile(-1):ENDPROC 28010SYSswi%,sd23_% 28020PROCchecksubset:ENDPROC 28030 28040DEFPROCgauge:IFFNdeadfile(-1):ENDPROC 28050LOCALT%,M%:PROCgetw(w%(file%,1)) 28060M%=FNv_(16):R%=FNv_(17) 28070T%=(M%+(M%>0))*(mx%-x0%)/(326-6)+1:IFT%>R%T%=R% 28080SYSswi%,sd23_%TON% 28090IFT%=N%ENDPROC 28100SYSswi%,grec_%,T%TON% 28110PROCvalidrec:ENDPROC 28120 28130DEFPROCffind:IFFNdeadfile(-1):ENDPROC 28140LOCALT$:T$=$FNia(w%(file%,1),7):PROCstrip(T$):IFT$="":ENDPROC 28150IFINSTR(T$,"=")=0ANDVALMID$(T$,2)>0AND(ASCT$=35ORASCT$=64)THEN 28160CASEASCT$OF 28170WHEN35:SYSswi%,grec_%,VALMID$(T$,2) 28180WHEN64:SYSswi%,locate_%,VALMID$(T$,2) 28190ENDCASE 28200PROCvalidrec:ENDPROC 28210ENDIF 28220s$(file%)=T$:PROCdup(T$,0):ENDPROC 28230 28240DEFPROCffound 28250PROCseti(w%(file%,1),7,s$(file%)) 28260IFNOTFNbadrec(FNv_(15)):PROCchecksubset:ELSEPROCvalidrec 28270ENDPROC 28280 28290DEFPROCnextmatch:IFFNdeadfile(-1):ENDPROC 28300LOCALT$:IFs$(file%)=""THEN 28310SYSswi%,gfield_%,1 28320SYSswi%,strip_% 28330SYSswi%,upper_% 28340s$(file%)=$sd% 28350ENDIF 28360T$=s$(file%):PROCdup(T$,FNv_(14)):ENDPROC 28370 28380DEFPROCdup1(T$,T%):LOCALf$,t$,I%,d%:d%=FNv_(14) 28390PROCstrip(T$):I%=INSTR(T$,"="):IFI%>0THEN 28400t$=LEFT$(T$,I%-1):T$=MID$(T$,I%+1) 28410IFINSTR(t$,"{")>0ANDRIGHT$(t$)="}"THEN 28420f$=MID$(t$,INSTR(t$,"{")+1):f$=LEFT$(f$) 28430t$=LEFT$(t$,INSTR(t$,"{")-1) 28440ENDIF 28450ENDIF 28460f$+=m$(file%):SYSswi%,seek_%,T$,T%,t$,f$TOG% 28470IFG%=0:IFd%>0:IFNOTFNbadrec(d%):SYSswi%,locate_%,d% 28480ENDPROC 28490 28500DEFPROCdup(T$,T%):PROCdup1(T$,T%) 28510IFG%=0:PROCerr(36) 28520PROCffound:ENDPROC 28530 28540DEFPROCchecksubset 28550SYSswi%,sd23_%TON% 28560PROCsd35:IFG%THEN 28570PROCflg0(f_filt%):SYSswi%,subset_%,0 28580IFw%(file%,0)>0PROCshowfilter:PROCshowsub:PROCforcerep 28590ENDIF 28600PROCvalidrec 28610ENDPROC 28620 28630DEFPROCnewcard(T%,U%) 28640LOCALf%,I%:f%=file% 28650IFs%(file%)=0THEN 28660IF(FNbadrec(FNv_(15))ANDFNbadrec(FNv_(14)))THEN 28670s%(file%)=1:PROCforcecard 28680ELSE 28690IFU%PROCupdate(w%(file%,0)):ELSEPROCforce(w%(file%,0)) 28700ENDIF 28710ENDIF 28720IFT%:PROCmatchrep 28730PROCshownum:IFlinks%>0THEN 28740FORI%=0TOmaxf% 28750IFl%(I%)=file%+1:PROCsdfile(I%):PROCnewcard(T%,U%):PROCsdfile(f%) 28760NEXT 28770ENDIF:ENDPROC 28780 28790DEFPROCupdate(h%) 28800!q%=h% 28810CASEh%OF 28820OTHERWISEq%!4=-1E9:q%!8=-1E9:q%!12=1E9:q%!16=1E9 28830ENDCASE 28840PROCredraw(TRUE) 28850ENDPROC 28860 28870DEFFNnnums:LOCALT%,I%:FORI%=0TO9:SYSswi%,sd53_%,I%TOG% 28880IF$sd%>""T%+=1 28890NEXT:=T% 28900 28910DEFFNsubmax(s%):SYSswi%,sd53_%,s%TOG%:IFG%=0:=0 28930WHILE(G%AND1)=0:G%=G%>>>1:ENDWHILE:=G% 28940 28950DEFFNsubnum(T$):LOCALI%:T$=FNsu(T$):IFASCT$=94:T$=FNsu(MID$(T$,2)) 28960IFLENT$=1ANDASCT$>65ANDMID$(FNsubstr,ASCT$-65,1)=".":=ASCT$-65 28970FORI%=0TO9:SYSswi%,sd53_%,I%TOG% 28980SYSswi%,upper_% 28990IF$sd%=T$:=I%+256 29000NEXT:=-1 29010 29020DEFFNsubstr:SYSswi%,sd53_%TOG% 29030=$(sd%+16) 29040 29050DEFFNsubname(s%):SYSswi%,sd53_%,s%TOG% 29060=$sd% 29070 29080DEFFNsubdesc:LOCALT$,T%:T%=FNv_(11):IFT%=32T%=0 29090=FNsubdesc1(T%) 29100 29110DEFFNsubdesc1(T%) 29120IFT%=0:="All Cards" 29130IFT%>255:="Numeric: "+FNsubname(T%-256) 29140T$="":IFT%>31:T%=T%AND31:T$="NOT " 29150=T$+"Subset "+CHR$(T%+65) 29160 29170DEFFNsubdesc2(T%) 29180LOCALT$ 29190CASE TRUE OF 29200WHENT%=0ORT%=32:T$="All cards in file" 29210WHENT%>32ANDT%<64 29220T$=d$(file%,T%-33) 29230IFT$="":T$=FNsubdesc1(T%):ELSEIFLENT$<21T$="NOT("+T$+")" 29240WHENT%>0ANDT%<32:T$=d$(file%,T%-1):IFT$="":T$=FNsubdesc1(T%) 29250WHENT%>255:T$="Numeric subset: "+FNsubname(T%-256) 29260OTHERWISET$="" 29270ENDCASE 29280=T$ 29290 29300DEFFNsubdesc3(T%) 29310IFT%>255:=FNsubname(T%-256) 29320IFT%<31:=CHR$(T%+65) 29330="NOT-"+CHR$((T%AND31)+65) 29340 29350DEFFNsubdesc4(T%):IFT%>255:="^"+FNsubname(T%-256) 29360IFT%<31:="^"+CHR$(T%+65) 29370="(^"+CHR$(T%+33)+"=0)" 29380 29390DEFPROCstartopen:PROCwaitpoint 29400LOCALT$,T%:process%+=1 29410IFT$>"":PROCopenfile1(T$,0,0,"",0) 29420T$=FNArfVar("MultiStore$Function"):T%=INSTR(T$,":")+1 29430CASEVALT$OF 29440WHEN1:PROCpdriver 29450WHEN2,-1:IFLENT$>=T%:PROCopenfile1(MID$(T$,T%),0,0,"",0) 29460WHEN3:IFLENT$>=T%:PROCopenfile(MID$(T$,T%)) 29470ENDCASE 29480*unset MultiStore$Function 29490PROCnormpoint:IFFNevaluation:PROCerr(66) 29500ENDPROC 29510 29520DEFPROCready 29530IFfile%=edfile%PROCendedit 29540IFa%(file%)<=0THEN 29550CASE TRUE OF 29560WHENFNv_(15)=0ANDl%(file%)<=0:PROCvalidrec 29570ENDCASE 29580ELSE 29590CASEa%(file%)OF 29600WHEN1,2:a%(file%)=0:PROCvalidaterec 29610WHEN3:PROCstop(7,"Searching file "+FNfilename,ri$,file%) 29620WHEN4:PROCstop(9,FNactdesc,ri$,file%) 29630WHEN5,6:PROCstop(13,FNactdesc,ri$,file%) 29640WHEN7:PROCstop(16,FNactdesc,ri$,file%) 29650WHEN8:PROCstop(23,FNactdesc,ri$,file%) 29660WHEN9:PROCstop(24,FNactdesc,ri$,file%) 29670WHEN10:PROCstop(25,FNactdesc,ri$,file%) 29680WHEN11:PROCstop(40,FNactdesc,ri$,file%) 29690ENDCASE 29700ENDIF 29710PROCnewdelay 29720ENDPROC 29730 29740DEFPROCcloseok 29750PROCstop(2,"","Close file "+FNfilename,file%) 29760ENDPROC 29770 29780DEFFNfilename 29790SYSswi%,stat_%TOG% 29800=RIGHT$(FNleaf($sd%),10) 29810 29820DEFFNofilename(I%):IFI%<0ORh%(I%)<1:="" 29830LOCALf%,T$:f%=file% 29840PROCsdfile(I%):T$=FNfilename:PROCsdfile(f%):=T$ 29850 29860DEFPROCswpane 29870PROCflgx(f_pane%):IFFNflg(f_pane%)THEN 29880PROCgetw(w%(file%,0)) 29890PROCopen(w%(file%,0),x0%,y0%,x1%,y1%,scx%,scy%,bhandle%) 29900ELSE 29910PROCgetw(w%(file%,1)) 29920PROCopen(w%(file%,1),x0%,y1%-paneh%,x0%+panew%,y1%,scx%,scy%,-2) 29930PROCclosew(w%(file%,1)) 29940ENDIF 29950ENDPROC 29960 29970DEFPROCforcecard:PROCforce(w%(file%,0)):PROCforcecardrep:ENDPROC 29980 29990DEFPROCforcecardrep:SYSswi%,sd23_%TON% 30000PROCforcecardsrep(N%,N%):ENDPROC 30010 30020DEFPROCforcecardsrep(T%,U%):IFr%(file%)=4PROCforcerep:ENDPROC 30030IFw%(file%,3)<=0ORr%(file%)>2ORs%(file%)<>0ENDPROC 30040LOCALh%:h%=1:IFr%(file%)=0:h%=FNrht 30050IFT%>U%SWAPT%,U% 30060ty1%=-margin%-h%*(T%-1)*linegap%+4:IFr%(file%)=1:ty1%-=2*linegap% 30070ty0%=ty1%-(U%-T%+1)*h%*linegap%+1:ty1%+=4 30080SYS"Wimp_ForceRedraw",w%(file%,3),0,ty0%,1E9,ty1% 30090ENDPROC 30100 30110DEFPROCforcerep:IFw%(file%,3)>0PROCforce(w%(file%,3)) 30120ENDPROC 30130 30140DEFFNdeadfile(f%) 30150LOCALT%:T%=FNdeadfile1(f%):IFT%THEN 30160PROCbuzz 30170ELSE 30180PROCready:T%=FNdeadfile1(f%):IFT%:PROCbuzz 30190ENDIF 30200=T% 30210 30220DEFFNdeadfile1(f%) 30230LOCALI% 30240FORI%=0TO30 30250IFf%AND(2^I%)THEN 30260CASEI%OF 30270WHEN0,1,2,3:IFs%(file%)=I%+1:=TRUE 30280WHEN4:IFa%(file%)<3ANDa%(file%)>0:PROCready:=FALSE:ELSEIFa%(file%)<>0:=TRUE 30290WHEN5:IFFNv_(15)=0:=TRUE 30300WHEN6:IFa%(file%)<>8ANDa%(file%)>2:=TRUE 30310WHEN7:IFl%(file%)>0:=TRUE 30320ENDCASE 30330ENDIF 30340NEXT 30350=FALSE 30360 30370DEFFNmacmode=fl%(file%)AND(f_macb%ORf_mace%) 30380 30390DEFFNdefon=(FNhdbyte1(29)AND64)>0 30400 30410DEFFNhdbyte(T%):SYSswi%,sd13_%,T%,sd$TOG% 30420DEFFNhdbyte1(T%):SYSswi%,sd13_%,T%TOG% 30430=G% 30440 30450DEFPROCswmacro 30460IFFNmacmode:PROCflg0(f_macb%):PROCflg0(f_mace%):ELSEPROCflg1(f_mace%) 30470PROCshowmac:ENDPROC 30480 30490DEFPROCswdefault 30500IFFNdefon THEN 30510SYSswi%,default_%,"Off" 30520ELSE 30530SYSswi%,default_%,"On" 30540ENDIF 30550ENDPROC 30560 30570DEFPROCinitsort 30580w_sort%=FNcrwind(tw_sort%):PROCsdfile(menufile%) 30590PROCunselall(w_sort%) 30600PROCseti(w_sort%,0,"Sort file "+FNfilename) 30610IFo%(file%,0)AND1:PROCseli(w_sort%,3)ELSEPROCseli(w_sort%,4) 30620IFo%(file%,0)AND2:PROCseli(w_sort%,5) 30630PROCseti(w_sort%,2,o$(file%)) 30640PROCdialogue(w_sort%):ENDPROC 30650 30660DEFPROCqbscan(T$,RETURN Q%,RETURN B%) 30670LOCALI%,T%:Q%=FALSE:B%=0:FORI%=1TOLENT$:T%=ASCMID$(T$,I%) 30680IFT%=34:Q%=NOTQ% 30690IFNOTQ%THEN 30700IFT%=ASC"(":B%+=1:ELSEIFT%=ASC")":B%-=1 30710ENDIF 30720NEXT:ENDPROC 30730 30740DEFPROCptrexit(h%) 30750IFsbfile%>=0:PROCsubdisp:sbfile%=-1:PROCnewdelay 30760ENDPROC 30770 30780DEFPROCptrenter(h%) 30790PROCwtof(h%):IFfile%>=0THEN 30800IFwind%=2:sbfile%=file%:PROCsubdisp:PROCnewdelay 30810ENDIF 30820ENDPROC 30830 30840DEFPROCsubdisp1:LOCALsbfile%:sbfile%=file%:PROCsubdisp:ENDPROC 30850 30860DEFPROCsubdisp:IFsbfile%<0:ENDPROC 30870LOCALT$,T%,C%:IFw%(sbfile%,2)<=0:ENDPROC 30880PROCreadpointer:PROCwtof(mh%) 30890T%=&F000000:IFwind%=2ANDfile%=sbfile%:T$=FNsubdesc2(FNitos) 30900C%=&D000000:IFT$=""C%=&7000000:PROCsdfile(sbfile%):T$=FNsubdesc2(FNv_(11)) 30910PROCgeti(w%(sbfile%,2),0) 30920IF(q%!24ANDT%)<>C%:PROCiset(w%(sbfile%,2),0,T%,C%) 30930IFT$<>$FNia(w%(sbfile%,2),0):PROCseti(w%(sbfile%,2),0,T$) 30940ENDPROC 30950 30960DEFPROCsubs 30970IFw%(file%,2)<=0:PROCmakesubs(file%):ENDPROC 30980PROCfront(w%(file%,2),-1,-1) 30990ENDPROC 31000 31010DEFPROCfilter 31020IFNOTFNdeadfile(%11111111111111110)THEN 31030IFmb%=1:PROCnofilt:ELSEPROCexpr(0) 31040ENDIF 31050ENDPROC 31060 31070DEFPROCnotepad 31080IFw%(file%,6)<=0:PROCmakenotes(file%):ENDPROC 31090PROCfront(w%(file%,6),-1,-1) 31100ENDPROC 31110 31120DEFPROCmacro 31130IFw%(file%,7)<=0:PROCmakemacro(file%):ENDPROC 31140PROCfront(w%(file%,7),-1,-1) 31150ENDPROC 31160 31170DEFPROCrepwind 31180IFw%(file%,3)<=0:PROCmakerep(file%):ENDPROC 31190PROCfront(w%(file%,3),-1,-1) 31200ENDPROC 31210 31220DEFPROCfieldlist 31230IFw%(file%,4)<=0:PROCmakeflist(file%):ENDPROC 31240PROCfront(w%(file%,4),-1,-1) 31250ENDPROC 31260 31270DEFPROCindex 31280IFw%(file%,5)<=0:PROCmakeilist(file%):ENDPROC 31290PROCfront(w%(file%,5),-1,-1) 31300ENDPROC 31310 31320DEFPROCdelicon(h%,i%):!q%=h%:q%!4=i%:SYS"Wimp_DeleteIcon",,q%:ENDPROC 31330 31340DEFPROCloseicon(h%,i%):PROCgeti(h%,i%):PROCdelicon(h%,i%) 31350q%!4=!q%:q%!8=-1E9:q%!12=-1E9:q%!16=-1E9:q%!20=-1E9 31360SYS"Wimp_CreateIcon",,q%+4:ENDPROC 31370 31380DEFPROCcarddr 31390LOCALT%,U% 31400PROCwtof(mh%):IFfile%>=0THEN 31410IFfile%=menufile%THEN 31420CASEwind%OF 31430WHEN2:T%=FNitos:IFT%>0ANDT%<255THEN 31440SYSswi%,sd23_%TON% 31450U%=N%:PROCsubbyte(T%,-1):PROCvalidaterec:PROCforcecardsrep(U%,U%) 31460ENDIF 31470ENDCASE 31480ELSE 31490CASEwind%OF 31500WHEN0,1:PROCcopycard 31510ENDCASE 31520ENDIF 31530ELSE 31540CASEmh%OF 31550WHENw_rlink%:IFmi%=1:IFmenufile%<>dialfile%:PROCsdfile(menufile%):PROCseti(mh%,mi%,FNfilename) 31560OTHERWISE:PROCsdfile(menufile%):PROCsavereq("Card",&FFF,FNwd*FNht,1,file%) 31570ENDCASE 31580ENDIF 31590ENDPROC 31600 31610DEFPROCcarddr1 31620tx0%=!q%:tx1%=q%!8:ty0%=q%!4:ty1%=q%!12 31630IFABS(tx0%-tx1%)<10ANDABS(ty0%-ty1%)<10:mb%=1:PROCselect:ENDPROC 31640PROCcxconv(tx0%):PROCcxconv(tx1%):PROCcyconv(ty0%):PROCcyconv(ty1%) 31650IFtx0%>tx1%:SWAPtx0%,tx1% 31660IFty0%>ty1%:SWAPty0%,ty1% 31670PROCsavew(f_cd$,&FFF,2,file%,(tx1%-tx0%+1)*(ty1%-ty0%+1)) 31680ENDPROC 31690 31700DEFPROCfielddr:LOCALf% 31710PROCwtof(mh%):IFfile%>=0THEN 31720CASEwind%OF 31730WHEN0:PROCfielddrc 31740WHEN1 31750CASEmi%OF 31760WHEN7 31770IFmenufield%>0f%=file%:PROCsdfile(menufile%):PROCseti(mh%,mi%,FNs(FNgfield(menufield%))):PROCsdfile(f%):PROCffind 31780WHEN18,25 31790IFmenufield%>0PROCsdfile(menufile%):PROCtonedial(FNs(FNgfield(menufield%))) 31800ENDCASE 31810WHEN3:IFmenufield%>0THEN 31820CASEr%(file%)OF 31830WHEN1 31840IFmenufile%=file%THEN 31850LOCALT$,t$ 31860T$=sr$(file%):IFLENT$<250THEN 31870IFINSTR(FNu(T$),FNu(FNfname(menufield%)))=0THEN 31880IFT$>""ANDRIGHT$(T$)<>","T$+="," 31890T$+=FNfname(menufield%):t$=FNx5(T$):srx$(file%)=t$:sr$(file%)=T$ 31900PROCforcerep 31910ENDIF 31920ENDIF 31930ENDIF 31940WHEN4 31950LOCALT% 31960IFmenufile%=file%THEN 31970PROCgetw(mh%):T%=(by%-margin%-my%-4)DIVlinegap% 31980IFT%>=0ANDT%<=14THEN 31990IFw_word%>0THEN 32000PROCseti(w_word%,T%,FNaddfield($FNia(w_word%,T%),menufield%)) 32010ELSE 32020IFINSTR(FNu(w$(file%,T%)),FNu(FNfname(menufield%)))=0THEN 32030w$(file%,T%)=FNaddfield(w$(file%,T%),menufield%):PROCforcerep 32040ENDIF 32050ENDIF 32060ENDIF 32070ENDIF 32080WHEN5 32090PROCgetw(mh%):PROCmousecol:IFcolumn%<0PROCaddcolumn 32100PROCr_setcol(menufield%,column%):PROCforcerep 32110ENDCASE 32120ENDIF 32130OTHERWISE:IFFNenterfield 32140ENDCASE 32150ELSE 32160IFNOTFNenterfield:IFmenufield%>0:PROCsavereq("Field",&FFF,255,3,menufile%) 32170ENDIF 32180ENDPROC 32190 32200DEFPROCnotedr 32210PROCwtof(mh%) 32220IFNOTFNenternote:PROCsavereq("Note",&FFF,80,4,menufile%) 32230ENDPROC 32240 32250DEFPROCsubsdr 32260LOCALT%,T$ 32270PROCsubdisp1:PROCwtof(mh%):IFfile%>=0THEN 32280IFfile%=menufile%THEN 32290CASEwind%OF 32300WHEN0,1:PROCselsub(menusub%) 32310WHEN2: 32320T%=FNitos:IFT%>0ANDT%<255ANDmenusub%<255ANDmenusub%<>T%THEN 32330PROCselsub(menusub%) 32340e%(file%,0)=menusub%:e%(file%,1)=T%:T$="combine subsets":T%=12 32350e%(file%,2)=0:IFdragbutton%<>16T$="copy subset":T%=11 32360PROCstop(T%,"Subset "+FNsubdesc3(menusub%)+" � "+FNsubdesc3(e%(file%,1)),rl$+T$+" ?",file%) 32370ENDIF 32380OTHERWISE:IFFNentersub 32390ENDCASE 32400ENDIF 32410ELSE 32420CASEmh%OF 32430OTHERWISE:IFNOTFNentersub 32440ENDCASE 32450ENDIF 32460ENDPROC 32470 32480DEFFNenterfield 32490LOCALW%,T%,T$,t$:RESTORE33330 32500REPEAT:PROCreadh(W%):IFW%<>mh%THEN 32510IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 32520ELSE 32530REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 32540IFW%=mi%THEN 32550CASET%OF 32560WHEN1,4 32570PROCwtof(mh%):IFfile%<0:IFmh%=dialogue%:PROCsdfile(dialfile%) 32580T$="":IFfile%<>menufile%T$="\"+FNofilename(menufile%) 32590PROCsdfile(menufile%) 32600T$=FNaddfield($FNia(mh%,mi%),menufield%)+T$:PROCseti(mh%,mi%,T$) 32610WHEN5:IFFNthisfile(mh%,menufile%)THEN 32620PROCsdfile(menufile%):SYSswi%,sd17_%,9,menufield%,sd$TOG% 32630SYSswi%,sd17_%,10,$sd%TOG% 32640IFINSTR($sd%,"K")PROCseti(mh%,mi%,FNfname1(menufield%)) 32650ENDIF 32660WHEN6:PROCsdfile(menufile%):PROCseti(mh%,mi%,FNaddfield($FNia(mh%,mi%),menufield%)) 32670WHEN7 32680PROCwtof(mh%):IFfile%<0:IFmh%=dialogue%:PROCsdfile(dialfile%) 32690PROCsdfile(menufile%):T$=$FNia(mh%,mi%) 32700IFT$<>""ANDRIGHT$(T$)<>","T$+="," 32710PROCseti(mh%,mi%,T$+FNfname(menufield%)) 32720ENDCASE 32730ENDIF 32740=TRUE 32750ENDIF 32760UNTILW%<0 32770=FALSE 32780 32790DEFFNenternote 32800LOCALW%,T%:RESTORE33330 32810REPEAT:PROCreadh(W%):IFW%<>mh%THEN 32820IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 32830ELSE 32840REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 32850IFW%=mi%THEN 32860CASET%OF 32870WHEN1,4,6,7 32880IFdragbutton%=64AND(FNthisfile(mh%,menufile%)ORT%=6)THEN 32890IFmi%<>menufield%ORmh%<>w%(menufile%,6)PROCseti(mh%,mi%,$FNia(mh%,mi%)+"'"+CHR$(menufield%+65)) 32900ELSE 32910PROCseti(mh%,mi%,FNnote(menufile%,menufield%)) 32920ENDIF 32930WHEN8:IFedicon%>=0THEN 32940T$=FNnote(menufile%,menufield%) 32950IFdragbutton%<>64:T$=LEFT$($edbuf%,255-LENT$)+T$ 32960PROCsetct(mh%,mi%,0):PROCseti(mh%,mi%,T$) 32970ENDIF 32980ENDCASE 32990ENDIF 33000=TRUE 33010ENDIF 33020UNTILW%<0 33030=FALSE 33040 33050DEFFNentersub 33060LOCALW%,T%:RESTORE33330 33070REPEAT:PROCreadh(W%):IFW%<>mh%THEN 33080IFW%<>-1:REPEAT:READW%,T%:UNTILW%<0:W%=0 33090ELSE 33100REPEAT:READW%,T%:UNTILW%=mi%ORW%<0 33110IFW%=mi%THEN 33120CASET%OF 33130WHEN1 33140IFFNthisfile(mh%,menufile%)PROCsdfile(menufile%):PROCseti(mh%,mi%,$FNia(mh%,mi%)+FNsubdesc4(menusub%)) 33150WHEN2:PROCsfsub(menusub%) 33160WHEN3:PROCstsub(menusub%) 33170WHEN6:PROCsdfile(menufile%):PROCseti(mh%,mi%,$FNia(mh%,mi%)+FNsubdesc4(menusub%)) 33180ENDCASE 33190ENDIF 33200=TRUE 33210ENDIF 33220UNTILW%<0 33230=FALSE 33240REM ;{n reasons are 33250REM ;{n 1=enter field/subset/note for expression, any file 33260REM ;{n 2=source subset for search 33270REM ;{n 3=target " " " 33280REM ;{n 4=enter field/note for expression, any file 33290REM ;{n 5=enter key field/index name only, this file only 33300REM ;{n 6=enter field/subset/note for expr, no file ref 33310REM ;{n 7=enter field name/note into comms sep. list 33320REM ;{n 8=enter note contents (sel=over,adj=append) 33330DATAw_expr%,17,1,20,2,21,3,-1,-1 33340DATAw_sort%,2,4,-1,-1 33350DATA"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 33360DATA"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 33370DATAw_rlink%,5,6,3,5,-1,-1 33380DATAw_srset%,3,7,-1,-1 33390DATAw_word%,0,4,1,4,2,4,3,4,4,4,5,4,6,4,7,4,8,4,9,4,10,4,11,4,12,4,13,4,14,4,-1,-1 33400DATAw_rset2%,42,1,44,1,-1,-1 33410DATAw_col%,22,1,-1,-1 33420DATA"w%(file%,0)",edicon%,8,-1,-1 33430DATA"w%(file%,3)",edicon%,8,-1,-1 33440DATA-1 33450 33460DEFPROCnewdelay 33470LOCALI%:delay%=2E9 33480IFprocess%>0:delay%=0 33490FORI%=0TOmaxf%:IFa%(I%)<>0:delay%=0 33500NEXT:IFsbfile%>=0:delay%=0 33510ENDPROC 33520 33530DEFPROCsavedata 33540IFq%!12<>saveref%:ENDPROC 33550file$=FNzts(q%+44):PROCsavedata1:ENDPROC 33560 33570DEFPROCsavedata1:PROCclosew(w_save%) 33580IFsavefile%>=0:PROCsdfile(savefile%) 33590outfile%=0:outfile%=OPENOUTfile$:IFoutfile%=0:ENDPROC 33600LOCALERROR 33610ONERRORLOCAL:RESTOREERROR:CLOSE#outfile%:PROCerr(0) 33620CASEsavereason%OF 33630WHEN1:PROCsavecard:PROCnewfn(f_cd$) 33640WHEN2:PROCsavecard1:PROCnewfn(f_cd$) 33650WHEN3:PROCsavefield 33660WHEN4:PROCsavenote 33670WHEN5:PROCsavenotes:PROCnewfn(f_np$) 33680WHEN6:PROCsavemacro:PROCnewfn(f_mc$) 33690WHEN7:PROCsaverep:PROCnewfn(f_rx$) 33700WHEN8:PROCsavesetup 33710WHEN9:PROCsavepd:PROCnewfn(f_pd$) 33720ENDCASE 33730RESTOREERROR:CLOSE#outfile% 33740PROCsettype(file$,savetype%):PROCloadmess 33750savereason%=-1:savefile%=-1:PROCnomenu 33760ENDPROC 33770 33780DEFPROCsettype(file$,type%) 33790LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 33800OSCLI"settype "+file$+" "+STR$~type% 33810ENDPROC 33820 33830DEFPROCsavecard:IFFNdeadfile(%1111111101111111):ENDPROC 33840IFINKEY-3THENPROCdprint(FNstatstr):ENDPROC 33850LOCALI%:FORI%=1TOFNht:SYSswi%,gline_%,I%,sd$ 33860PROCdprint($sd%):NEXT:ENDPROC 33870 33880DEFPROCsavecard1:IFFNdeadfile(%1111111101111111):ENDPROC 33890LOCALI%:FORI%=ty0%TOty1%:SYSswi%,gline_%,I%,sd$ 33900PROCdprint(MID$($sd%,tx0%,tx1%-tx0%+1)):NEXT:ENDPROC 33910 33920DEFPROCsavefield:PROCdprint(FNs(FNgfield(menufield%))):ENDPROC 33930 33940DEFPROCsavenote:PROCdprint(FNs(FNnote(file%,menufield%))):ENDPROC 33950 33960DEFPROCsavenotes 33970LOCALI%:FORI%=0TO18:PROCdprint(FNs(FNnote(file%,I%))):NEXT:ENDPROC 33980 33990DEFPROCsavemacro 34000LOCALI%:FORI%=0TO29:PROCdprint(FNs(FNmacln(file%,I%))):NEXT:ENDPROC 34010 34020DEFPROCsaverep 34030LOCALERROR 34040ONERRORLOCAL:RESTOREERROR:PROCvalidrec:PROCerr(46) 34050outrep%=1:PROCinitrep:CASEr%(file%)OF 34060WHEN0:PROCsaverep0 34070WHEN1:PROCsaverep1 34080WHEN2:PROCsaverep2 34090WHEN3:PROCsaverep3 34100WHEN4:PROCsaverep4 34110WHEN5:PROCsaverep5 34120ENDCASE 34130PROCvalidrec:ENDPROC 34140 34150DEFPROCsaverep0:LOCALh%,I%:h%=FNht 34160REPEAT:PROCsdnext:IFFNv_(15)<=FNv_(17)THEN 34170FORI%=1TOh%:SYSswi%,gline_%,I%,sd$ 34180PROCdprint($sd%):IFINKEY0=27:ENDPROC 34190NEXT:IFh%>1:PROCdprint("") 34200ENDIF 34210UNTILFNv_(15)>FNv_(17):ENDPROC 34220 34230DEFPROCsaverep1:LOCALI%,T$ 34240REPEAT:UNTILFNrep1(TRUE):ENDPROC 34250 34260DEFFNrep1(T%) 34270IFFNv_(15)=0THEN 34280SYSswi%,accumulate_%,0,srx$(file%) 34290IFFNflg(f_stit%)PROCoprint(FNsrep(0),T%):IFFNflg(f_sdas%)PROCoprint(FNsrep(1),T%) 34300ENDIF 34310PROCsdnext:N%=FNv_(15) 34320LOCALERROR 34330ONERRORLOCAL:IFERR=17ANDT%:N%=FNv_(17)+1:PROCoprint("*** Interrupted ***",T%):ELSERESTOREERROR:PROCerr(0) 34340IFT%:*fx229 34350IFN%<=FNv_(17)THEN 34360SYSswi%,accumulate_%,-1 34370SYSswi%,line_%,-1 34380IFFNflg(f_srup%):SYSswi%,upper_% 34390PROCoprint($sd%,T%) 34400ENDIF 34410*fx229,1 34420RESTOREERROR 34430IFN%>FNv_(17)THEN 34440IFFNflg(f_stot%)THEN 34450IFFNflg(f_sdas%)THEN 34460SYSswi%,line_%,-2 34470PROCoprint($sd%,T%) 34480ENDIF 34490SYSswi%,line_%,-3 34500PROCoprint($sd%,T%) 34510ENDIF 34520SYSswi%,line_%,0,1 34530=TRUE 34540ENDIF 34550=FALSE 34560 34570DEFPROCsaverep2:LOCALI%,T$ 34580REPEAT:PROCsdnext:IFFNv_(15)<=FNv_(17)THEN 34590T$=FNrlin(FNv_(15),255) 34600PROCdprint(MID$(T$,12)) 34610IFINKEY0=27:ENDPROC 34620ENDIF 34630UNTILFNv_(15)>FNv_(17):ENDPROC 34640 34650DEFPROCsaverep3:LOCALI%,T$ 34660REPEAT:PROClabline(0,TRUE) 34670IFINKEY0=27:ENDPROC 34680UNTILe%(file%,2)=-1:ENDPROC 34690 34700DEFPROCsaverep4:LOCALI%,T$,T%,t$,t%,s%,b% 34710t$="FNwordout"+STR$wo%(file%)+"(outfile%,t%,T$)" 34720T$="":t%=0:T%=EVALt$:REPEAT 34730PROCsdnext:IFFNv_(15)<=FNv_(17)THEN 34740T$="":t%=1:T%=EVALt$ 34750I%=0:b%=0:t%=2:REPEAT 34760T$=FNs(w$(file%,I%)):IFT$<>""THEN 34770LOCALERROR 34780T%=FALSE:ONERRORLOCAL:T$=" ** "+REPORT$:T%=TRUE 34790IFNOTT%THEN 34800T$=FNs(FNx(T$)) 34810IFFNu(T$)="END"THEN 34820I%=99 34830ELSE 34840T$=FNev3(T$,FNflg(f_wspc%),FNflg(f_wupp%),&90A) 34850ENDIF 34860ENDIF 34870RESTOREERROR 34880IFI%<>99THEN 34890IFFNflg(f_wbnk%)ANDT$=STRING$(LENT$," ")THEN 34900b%+=1 34910ELSE 34920T%=EVALt$:t%=3 34930ENDIF 34940ENDIF 34950ENDIF 34960I%+=1:UNTILI%>14 34970T$="":WHILEb%>0:T%=EVALt$:t%=3:b%-=1:ENDWHILE 34980T$="":t%=4:T%=EVALt$ 34990ENDIF 35000UNTILFNv_(15)>FNv_(17)ORINKEY0=27:T$="":t%=5:T%=EVALt$:ENDPROC 35010 35020DEFPROCsaverep5 35030REPEAT:IFINKEY0=27:ENDPROC 35040UNTILNOTFNprline 35050ENDPROC 35060 35070DEFFNitos 35080IFmi%>4ANDmi%<29:=mi%-4+32 35090IFmi%>28ANDmi%<53:=mi%-28 35100IFmi%=1:=0 35110IFmi%>52ANDmi%<63:=mi%-53+256 35120=-1 35130 35140DEFFNmousef:LOCALX%,Y%:X%=mx%:Y%=my%:PROCcyconv(Y%):PROCcxconv(X%) 35150LOCALERROR:ONERRORLOCAL:PROCsdfile(file%):=0 35160SYSswi%,sd52_%,X%,Y%,sd$TOG% 35170PROCsdfile(file%):=G% 35180 35190DEFPROCdragfield:PROCfieldsz(menufield%) 35200!q%=w%(file%,0):q%!8=bx%+tx0%:q%!12=by%+ty0%:q%!16=bx%+tx1% 35210q%!20=by%+ty1%:q%!24=0:q%!28=0:q%!4=5:PROCdrag5:ENDPROC 35220 35230DEFPROCdragfield1:LOCALY% 35240PROCgetw(w%(file%,4)):Y%=by%-menufield%*linegap%-margin%+linegap% 35250q%!8=bx%+margin%:!q%=w%(file%,4):q%!12=Y%-32:q%!16=bx%+ex1%-margin% 35260q%!20=Y%:q%!24=0:q%!28=0:q%!4=5:PROCdrag5:ENDPROC 35270 35280DEFPROCdragcard:IFFNdialogue:ENDPROC 35290!q%=w%(file%,0):PROCgetw(!q%) 35300q%!8=mx%:q%!12=my%:q%!16=mx%:q%!20=my% 35310q%!24=bx%+ex0%+margin%:q%!28=by%+ey1%-margin%-FNht*linegap% 35320q%!32=bx%+ex0%+margin%+FNwd*16 35330q%!36=by%+ey1%-margin%:q%!4=6:SYS"Wimp_DragBox",,q% 35340ENDPROC 35350 35360DEFPROCselsub(s%):IFs%>255ORs%<0:ENDPROC 35370IFs%=FNv_(11)ANDs%(file%)<>1:ENDPROC 35380PROCzfound:SYSswi%,subset_%,s% 35390PROCrevalidate:PROCshowsub:ENDPROC 35400 35410DEFPROCcxconv(RETURN X%):PROCxconv(X%,FNwd,w%(file%,0)):ENDPROC 35420DEFPROCcyconv(RETURN Y%):PROCyconv(Y%,FNht,w%(file%,0)):ENDPROC 35430 35440DEFPROCyconv(RETURN Y%,T%,h%):PROCgetw(h%) 35450Y%=(by%-Y%-margin%)DIVlinegap%+1:IFY%<1Y%=1ELSEIFY%>T%Y%=T% 35460ENDPROC 35470 35480DEFPROCxconv(RETURN X%,T%,h%):PROCgetw(h%) 35490X%=(X%-bx%-margin%)DIV16+1:IFX%<1X%=1ELSEIFX%>T%X%=T% 35500ENDPROC 35510 35520DEFPROCsavew(f$,T%,r%,f%,s%) 35530PROCsaveset(f$,T%,r%,f%,s%) 35540PROCdialogue(w_save%):ENDPROC 35550 35560DEFPROCsaveset(f$,T%,r%,f%,s%) 35570savereason%=r%:savefile%=f%:savet%=T%:saves%=s% 35580PROCseti(w_save%,2,f$):$FNva(w_save%,3)="sfile_"+RIGHT$("00"+STR$~T%,3) 35590ENDPROC 35600 35610DEFPROCCLOSE 35620LOCALI% 35630FORI%=0TOmaxf% 35640IFh%(I%)>0:closeok%=TRUE:PROCclosefile(I%) 35650NEXT:ENDPROC 35660 35670DEFPROCprequit 35680IFFNv_(1)>0PROCackrec:PROCqquit 35690ENDPROC 35700 35710DEFPROCackrec:q%!12=ref%:SYS"Wimp_SendMessage",19,q%,task% 35720DEFPROCqquit:PROCstop(6,"Close files and quit",as$,-1) 35730ENDPROC 35740 35750DEFPROCopenform 35760LOCALT$:T$=FNzts(q%+44) 35770IFFNdeadfile(%11111111101111110)ENDPROC 35780PROCcloseform 35790LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(7) 35800SYSswi%,oform_%,T$ 35810f%(file%)=-FNv_(2) 35820PROClink 35830ENDPROC 35840 35850DEFPROCcloseform:IFf%(file%)=0:ENDPROC 35860IFf%(file%)>0:PROClink 35870SYSswi%,cform_%,f%(file%)TOS%:f%(file%)=0 35880ENDPROC 35890 35900DEFPROClink 35910f%(file%)=-f%(file%) 35920IFf%(file%)<0THEN 35930SYSswi%,sform_%,h%(file%) 35940ELSE 35950SYSswi%,lform_%,f%(file%),h%(file%) 35960ENDIF 35970PROCsdfile(file%):PROCfext:IFr%(file%)=0:PROCrext 35980IFw%(file%,4)>0PROCmakeflist(file%) 35990ENDPROC 36000 36010DEFFNgfield(T%) 36020SYSswi%,sd17_%,9,T%,sd$TOG% 36030SYSswi%,gfield_%,$sd%,sdf$ 36040=$sd% 36050 36060DEFPROCpfield(T%,T$):IFFNreadonly:PROCbuzz1:ENDPROC 36070PROCendedit:edrec%=FNv_(15):$edbuf%=T$:edfield%=T%:edfile%=file% 36080PROCendedit:ENDPROC 36090 36100DEFFNfname(T%):SYSswi%,sd17_%,9,T%,sd$TOG% 36110=$sd% 36120 36130DEFFNfname1(T%):IFT%<0:="N%":ELSESYSswi%,sd17_%,4,T%,sd$TOG% 36140IF(G%AND7)=7:="@"+FNfname(T%):ELSE="#"+FNfname(T%) 36150 36160DEFFNfnum(T$):SYSswi%,sd67_%,T$,sd$TOG% 36170=G% 36180 36190DEFPROCexpr(r%) 36200dialreason%=r%:dialfile%=file% 36210LOCALT%,T$,A$,t$,s%,u% 36220T$=FNfilename:w_expr%=FNcrwind(tw_expr%):PROCunselall(w_expr%) 36230CASEr%OF 36240WHEN0 36250T$="Filter expression for file "+T$+":" 36260A$=f$(file%):$FNta(w_expr%)="Filter":exi0%=17 36270FORs%=18TO21:PROCloseicon(w_expr%,s%):NEXT:PROCloseicon(w_expr%,25) 36280PROCloseicon(w_expr%,27):PROCloseicon(w_expr%,29) 36290PROCloseicon(w_expr%,28):s%=FNflg(f_fspc%):u%=FNflg(f_fupp%) 36300WHEN1 36310T$=fi$+T$+", search for:" 36320A$=e$(file%):$FNta(w_expr%)="Search":exi0%=25 36330PROCloseicon(w_expr%,26) 36340s%=FNflg(f_sspc%):u%=FNflg(f_supp%):PROCflg0(f_sadd%) 36350e%(file%,0)=FNv_(11):T%=e%(file%,0)AND31:t$=FNsubstr:REPEAT 36360T%=(T%+1)MOD25:UNTIL(T%>0ANDMID$(t$,T%,1)=".")ORT%=e%(file%,0) 36370e%(file%,1)=T%:IFe%(file%,0)=T%e%(file%,0)=0 36380IFe%(file%,0)=e%(file%,1)PROCerr(61) 36390PROCsfsub(e%(file%,0)):PROCstsub(e%(file%,1)) 36400WHEN2 36410T$=fi$+T$+", report on:" 36420A$=r$(file%):$FNta(w_expr%)="Formula Report Setup":exi0%=17 36430FORs%=18TO21:PROCloseicon(w_expr%,s%):PROCloseicon(w_expr%,s%+7):NEXT 36440PROCloseicon(w_expr%,29):s%=FNflg(f_rspc%):u%=FNflg(f_rupp%) 36450ENDCASE 36460PROCseti(w_expr%,16,T$):PROCseti(w_expr%,17,A$):ex$=A$ 36470IFs%PROCseli(w_expr%,1) 36480IFu%PROCseli(w_expr%,0) 36490PROCdialogue(w_expr%):ENDPROC 36500 36510DEFPROCflg0(T%):fl%(file%)=fl%(file%)ANDNOTT%:ENDPROC 36520DEFPROCflg1(T%):fl%(file%)=fl%(file%)ORT%:ENDPROC 36530DEFPROCflgx(T%):fl%(file%)=fl%(file%)EORT%:ENDPROC 36540DEFPROCflgm(M%,F%):fl%(file%)=(fl%(file%)ANDNOTM%)OR(F%ANDM%):ENDPROC 36550DEFPROCflg(T%,F%):fl%(file%)=(fl%(file%)ANDNOTT%)OR((F%<>0)ANDT%):ENDPROC 36560DEFFNflg(T%)=(fl%(file%)ANDT%)<>0 36570 36580DEFPROCsetfilt:IFFNs($A%)="":PROCnofilt:ENDPROC 36590LOCALT$:T$=FNx1($A%) 36600PROCflg(f_fupp%,u%):PROCflg(f_fspc%,s%):f$(file%)=$A%:fx$(file%)=T$ 36610PROCflg(f_filt%,T$<>""):PROCshowfilter:PROCrevalidate:PROCzfound 36620ENDPROC 36630 36640DEFPROCnofilt:PROCflg0(f_filt%) 36650PROCzfound:PROCrevalidate:PROCshowfilter:ENDPROC 36660 36670DEFFNx1(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(8) 36680DEFFNx2(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(9) 36690DEFFNx3(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(34) 36700DEFFNx4(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(37) 36710DEFFNx5(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(44) 36720DEFFNx6(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(45) 36730DEFFNx7(T$):LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(52) 36740=FNx(T$) 36750 36760DEFFNx(A$):PROCstrip(A$):IFA$="":PROCerr(35) 36770LOCALQ%,B%,I%,z$:PROCqbscan(A$,Q%,B%):IFQ%PROCerr(10):ELSEIFB%PROCerr(11) 36780z$=A$:WHILEINSTR(z$,"'"):I%=INSTR(z$,"'") 36790J%=(ASCMID$(z$,I%+1))AND&DF 36800IFJ%<65ORJ%>83:PROCerr(29) 36810IFLENz$+LEN$FNtia(tw%(file%,6),J%-65)>250:PROCerr(30) 36820z$=LEFT$(z$,I%-1)+$FNtia(tw%(file%,6),J%-65)+MID$(z$,I%+2) 36830ENDWHILE:A$=FNX(z$):PROCstrip(A$):IFA$="":PROCerr(35):ELSE=A$ 36840 36850DEFFNX(A$):LOCALz$,J%,I%:z$=A$ 36860WHILEINSTR(A$,"=""*"):I%=INSTR(A$,"=""*") 36870z$=LEFT$(A$,I%-1)+","""+MID$(A$,I%+3) 36880J%=INSTR(z$,CHR$34,I%+2):IFJ%=0:PROCerr(10) 36890IFMID$(z$,J%-1,1)="*":z$=LEFT$(z$,J%-2)+MID$(z$,J%):J%-=1 36900z$=LEFT$(z$,J%)+")"+MID$(z$,J%+1):J%=I% 36910REPEAT:I%=I%-1:IFI%<0:PROCerr(31) 36920UNTILMID$(z$,I%,1)="@" 36930z$=LEFT$(z$,I%-1)+"FNi("+MID$(z$,I%) 36940A$=z$:ENDWHILE:=A$ 36950 36960DEFFNev(A$,s%,u%) 36970$sd%="N":IFs%$sd%+="S" 36980IFu%$sd%+="U" 36990SYSswi%,expand_%,A$,sd% 37000N%=FNv_(15):D%=FNv_(14) 37010=EVAL$sd% 37020 37030DEFFNev1(A$):=FNev(FNx(A$),macs%,macu%) 37040DEFFNev2(A$,s%,u%)=FNevgen(A$,s%,u%,&102050F,TRUE) 37050DEFFNev3(A$,s%,u%,A%)=FNevgen(A$,s%,u%,A%,TRUE) 37060DEFFNev4(A$,s%,u%)=FNevgen(A$,s%,u%,&102050F,FALSE) 37070DEFFNev5(A$):=FNev(FNx(A$),TRUE,FALSE) 37080 37090DEFFNevgen(A$,s%,u%,A%,T%) 37100LOCALU%,t:LOCALERROR 37110ONERRORLOCAL:RESTOREERROR:@%=&90A:U%=TRUE:IFERR<>6:PROCerr(0) 37120IFU%THEN 37130$sd%=FNev(A$,s%,u%) 37140ELSE 37150t=FNev(A$,s%,u%):@%=A%:$sd%=RIGHT$(" "+STR$t,15):@%=&90A 37160IFs%ANDT%:SYSswi%,strip_% 37170ENDIF 37180=$sd% 37190 37200DEFPROCwtidy 37210LOCALI%:FORI%=2TOmaxw%:IFw%(file%,I%)>0PROCclosew(w%(file%,I%)) 37220NEXT:ENDPROC 37230 37240DEFPROCsfsub(T%):PROCsdfile(dialfile%) 37250IFT%>255OR(T%AND31)=e%(file%,1):ENDPROC 37260PROCseti(w_expr%,20,FNsubdesc1(T%)):e%(file%,0)=T% 37270PROCselsub(T%):ENDPROC 37280 37290DEFPROCstsub(T%):IFT%<255T%=T%AND31 37300PROCsdfile(dialfile%):IFT%=0ORT%=(e%(file%,0)AND31):ENDPROC 37310PROCseti(w_expr%,21,FNsubdesc1(T%)):e%(file%,1)=T% 37320IFT%<255PROCseti(w_expr%,25,d$(file%,T%-1)) 37330ENDPROC 37340 37350DEFPROCbuzz1:SYSswi%,beep_%,100 37360DEFPROCbuzz:SYSswi%,beep_%,150 37370DEFPROCbuzz2:SYSswi%,beep_% 37380ENDPROC 37390 37400DEFPROCsearch 37410LOCALT$,T%:T%=e%(file%,1):IFs%(file%)=1:PROCerr(12) 37420IF$A%="DUP":ox$(file%)=FNx3(o$(file%)) 37430T$=FNx2($A%):PROCflg(f_sadd%,c%):PROCflg(f_supp%,u%):PROCflg(f_sspc%,s%) 37440ex$(file%)=T$:e$(file%)=$A%:IF$A%="DUP":ex$(file%)="#$%$#" 37450IFT%<25THEN 37460d$(file%,T%-1)=FNs($FNia(w_expr%,25)) 37470IFd$(file%,T%-1)=""THEN 37480d$(file%,T%-1)=FNtrunc($A%,21):T$="":IFe%(file%,0)>32T$="NOT " 37490T$+=CHR$((e%(file%,0)AND31)+65)+":" 37500IFFNflg(f_sadd%):T$="+"+T$ 37510IFLENd$(file%,T%-1)+LENT$<=25:d$(file%,T%-1)=T$+d$(file%,T%-1) 37520ENDIF 37530ENDIF 37540PROCstartact(3):e%(file%,2)=0 37550IFT%<255fc%(file%)=0 37560PROCshowfound:ENDPROC 37570 37580DEFPROCendsearch:LOCALt%:PROCendact 37590t%=fc%(file%):PROCselsub(e%(file%,1)):fc%(file%)=t%:PROCshowfound 37600ENDPROC 37610 37620DEFPROCendcsub:PROCendact:PROCselsub(e%(file%,1)):ENDPROC 37630 37640DEFPROCenddsub:PROCendact:PROCselsub(e%(file%,0)):ENDPROC 37650 37660DEFPROCendfill:PROCendact:ENDPROC 37670 37680DEFPROCsrcnext:LOCALT%,g% 37690LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendsearch:PROCerr(9) 37700e%(file%,2)+=1:T%=e%(file%,2):IFT%>FNv_(17):PROCendsearch:ENDPROC 37710SYSswi%,grec_%,T%TON%:PROCsd35:T%=e%(file%,1) 37720IFe$(file%)="DUP":PROCdupnext:ENDPROC 37730IFG%<>0:g%=0:ELSEPROCrlink(TRUE):g%=FNev(ex$(file%),FNflg(f_sspc%),FNflg(f_supp%)) 37740IFg%<>0ORNOTFNflg(f_sadd%)ORT%>255PROCsubbyte(T%,g%) 37750IFg%<>0ANDT%<255:fc%(file%)+=1:PROCshowfound 37760PROCshownum:ENDPROC 37770 37780DEFPROCcsubnext(t%):LOCALT%,g%,I% 37790LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendcsub:PROCerr(17) 37800FORI%=0TOchunk% 37810e%(file%,2)+=1:T%=e%(file%,2):IFT%>FNv_(17):PROCendcsub:ENDPROC 37820SYSswi%,grec_%,T%TON% 37830PROCsd35:g%=G%=0 37840IFg%ORt%=5:PROCsubbyte(e%(file%,1),g%) 37850NEXT:PROCshownum:ENDPROC 37860 37870DEFPROCsubbyte(T%,g%) 37880IFT%>255THEN 37890SYSswi%,sd53_%,T%-256TOG% 37900SYSswi%,sd51_%,G% 37910ELSE 37920IFT%>31T%-=32:g%=(g%=0) 37930SYSswi%,sd37_%,T%TOG% 37940ENDIF 37950SYSswi%,sd35_%,-1TOG% 37960IFG%<128:SYSswi%,sd34_%,g%,-1TOG% 37970SYSswi%,sd37_%TOG% 37980ENDPROC 37990 38000DEFPROCdsubnxt 38010LOCALT%,I% 38020FORI%=0TOchunk% 38030SYSswi%,first_%TO,N% 38040PROCsdnext:IFFNv_(15)>FNv_(17):PROCenddsub:ENDPROC 38050SYSswi%,delrec_%,-1 38060NEXT:PROCshownum:ENDPROC 38070 38080DEFPROCupdnxt 38090LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendact:PROCerr(0) 38100PROCsdnext:IFFNv_(15)>FNv_(17):PROCendact:ENDPROC 38110ONERRORLOCAL:RESTOREERROR:PROCflg(f_macb%,0):PROCshowmac:PROCendact:PROCerr(0) 38120PROCdomacro1:PROCshownum:ENDPROC 38130 38140DEFPROCprintnext 38150LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendact:PROCerr(43) 38160CASEr%(file%)OF 38170WHEN0:PROCprnx0 38180WHEN1:PROCprnx1 38190WHEN2:PROCprnx2 38200WHEN3:PROCprnx3 38210WHEN5:PROCprnx5 38220ENDCASE 38230PROCshownum:ENDPROC 38240 38250DEFPROCprnx0:LOCALI%,h%:h%=FNht 38260PROCsdnext:IFFNv_(15)>FNv_(17):PROCendrep:ENDPROC 38270FORI%=1TOh%:SYSswi%,gline_%,I%,sd$ 38280PROCpprint($sd%):NEXT 38290IFh%>1PROCpprint("") 38300ENDPROC 38310 38320DEFPROCprnx1:IFFNrep1(FALSE):PROCendrep 38330ENDPROC 38340 38350DEFPROCprnx2:LOCALT$ 38360PROCsdnext:IFFNv_(15)>FNv_(17):PROCendrep:ENDPROC 38370T$=FNrlin(FNv_(15),255) 38380PROCpprint(MID$(T$,12)):ENDPROC 38390 38400DEFPROCprnx3:PROClabline(0,FALSE) 38410ENDPROC 38420 38430DEFPROCprnx5 38440IFNOTFNprline:PROCendrep 38450ENDPROC 38460 38470DEFPROCendrep:PROCendact:ENDPROC 38480 38490DEFPROCfsubnxt 38500LOCALT%,I%,B%:T%=e%(file%,2):B%=e%(file%,1) 38510FORI%=0TOchunk%:T%+=1:IFT%>FNv_(17):PROCendfill:ENDPROC 38520e%(file%,2)=T%:SYSswi%,grec_%,T%TON% 38530PROCsubbyte(e%(file%,0),B%):NEXT:PROCshownum:ENDPROC 38540 38550DEFPROCsortnext:LOCALI%,J%,K%,L%,M%,T%,P% 38560LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendact:PROCerr(0) 38570I%=o%(file%,1):J%=o%(file%,2):K%=o%(file%,3):L%=o%(file%,4) 38580M%=o%(file%,5):P%=o%(file%,6):T%=(o%(file%,0)AND1)=1 38590IFL%=0:J%=1:K%=FNv_(17)-M%:IFJ%<=K%L%=1 38600IFL%=1:I%=J%:P%=I%+M%:IFI%>0L%=2 38610IFL%=2THEN 38620L$=FNso(P%):I$=FNso(I%):PROCshownum 38630IFI$<>L$THEN 38640IF(I$>L$)=T%:PROCswaprec(I%,P%):I%-=M%ELSEI%=-1 38650ELSE 38660I%=-1 38670ENDIF 38680P%=I%+M%:IFI%>0:PROCsortr:ENDPROC:ELSEL%=1 38690ENDIF 38700IFL%=1THEN 38710J%+=1:IFJ%<=K%:PROCsortr:ENDPROC:ELSEL%=0 38720ENDIF 38730IFL%=0THEN 38740M%=M%DIV2:IFM%>0:PROCsortr:ENDPROC:ELSEL%=-1 38750ENDIF 38760PROCsortr:ENDPROC 38770 38780DEFPROCsortr:o%(file%,1)=I%:o%(file%,2)=J%:o%(file%,3)=K% 38790o%(file%,4)=L%:o%(file%,5)=M%:o%(file%,6)=P% 38800IFL%<0PROCendact 38810ENDPROC 38820 38830DEFPROCzfound:IFfc%(file%)>=0fc%(file%)=-1:PROCshowfound 38840ENDPROC 38850 38860DEFPROCnumeric(r%) 38870dialreason%=r%:w_nums%=FNcrwind(tw_nums%) 38880PROCseti(w_nums%,2,""):PROCseti(w_nums%,3,"") 38890IFr%>0THEN 38900PROCseti(w_nums%,2,FNsubname(menusub%-256)) 38910PROCseti(w_nums%,3,STR$FNsubmax(menusub%-256)) 38920ENDIF:PROCdialogue(w_nums%):ENDPROC 38930 38940DEFFNactdesc 38950CASEa%(file%)OF 38960WHEN3:="Searching cards" 38970WHEN4:IFe%(file%,1):="Filling subset":ELSE="Clearing subset" 38980WHEN5:="Copying subset" 38990WHEN6:="Combining subsets" 39000WHEN7:="Destroying subset" 39010WHEN8:="Updating cards" 39020WHEN9:="Sorting cards" 39030WHEN10:="Printing report" 39040WHEN11:="Impulse Transmission" 39050OTHERWISE:="Linked to process" 39060ENDCASE:="" 39070 39080DEFPROCfillsub(T%) 39090e%(file%,0)=menusub%:e%(file%,1)=T%:e%(file%,2)=0 39100PROCstartact(4):ENDPROC 39110 39120DEFPROCdelsub 39130e%(file%,0)=menusub%:PROCselsub(menusub%) 39140PROCstartact(7):ENDPROC 39150 39160DEFPROCupdcards:LOCALI% 39170FORI%=0TO3:t%(file%,I%)=0:NEXT:SYSswi%,first_%TO,N% 39180PROCstartact(8):IFw%(file%,7)>0PROCclosew(w%(file%,7)) 39190ENDPROC 39200 39210DEFPROCprintrep 39220LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendact:PROCerr(0) 39230PROCgrabpr:outrep%=0:PROCinitrep 39240PROCstartact(10):ENDPROC 39250 39260DEFPROCinitrep 39270CASEr%(file%)OF 39280WHEN0,1,2:SYSswi%,first_%TO,N% 39290WHEN3 39300LOCALI%:SYSswi%,first_%TO,N% 39310PROCvalidrec:e%(file%,2)=FNv_(15):e%(file%,0)=0:e%(file%,1)=1 39320FORI%=0TOmaxacr%-1:l1%(file%,I%)=1:NEXT:labline%=0 39330WHEN4 39340SYSswi%,first_%TO,N% 39350vectors%=0:vec%=0:tuples%=0 39360WHEN5 39370PROCcheckrep:LOCALI%,J%:totals%=0:tlines%=0:ttot%=0:SYSswi%,first_%TO,N% 39380FORI%=0TOmaxcol%:PROCdecodecol(I%):FORJ%=0TO1:cv$(I%,J%)="":NEXT 39390FORJ%=0TO3:ct(I%,J%)=0:ct%(I%,J%)=0:NEXT 39400IFcexp$>""totals%-=(ctot%<>0):ttot%=ttot%ORctot% 39410NEXT:rlf%=file%:rsp%=-1:rpc%=2:rmf%=file%:rll%=maxf%+1:rpr%=TRUE 39420rpr1%=FALSE:lsubval$=" ":lssubval$=" ":fline%=-999 39430tlines%=VALMID$("01121223",(ttot%AND7)+1,1) 39440FORI%=0TOmaxf%:rl%(I%)=FALSE 39450IFI%<>rmf%ANDh%(I%)<>0THEN 39460T$="\"+FNu(FNofilename(I%)) 39470FORJ%=0TOmaxcol% 39480IFc$(file%,J%,0)>""THEN 39490IFINSTR(FNu(FNx7(c$(file%,J%,0))),T$)rl%(I%)=TRUE:J%=maxcol% 39500ENDIF 39510NEXT 39520ENDIF 39530NEXT:rl%(file%)=TRUE:pline%=0:ppage%=0:prfnt%=-1:prw%=FNprwidth 39540rphei%=p%(file%,3):rpwid%=p%(file%,2) 39550prl%=(1ANDFNflg(f_rldu%))OR(2ANDFNflg(f_rlsu%)) 39560IFoutrep%<>2:IFFNflg(f_rejb%):PROCpreject(TRUE) 39570ENDCASE 39580ENDPROC 39590 39600DEFPROCstartact(T%):PROCnomenu 39610s%(file%)=2:a%(file%)=T%:PROCforcecard:PROCforcerep:PROCnewdelay 39620PROCactlink(T%):ENDPROC 39630 39640DEFPROCendact 39650s%(file%)=0:a%(file%)=0:PROCactlink(0) 39660IFfile%=printer%:PROCreleasepr 39670PROCforcerep:PROCvalidrec2:PROCnewdelay:ENDPROC 39680 39690DEFPROCactlink(T%):IFlinks%=0:ENDPROC 39700LOCALf%,I% 39710FORI%=0TOmaxf%:IFl%(I%)=file%+1THEN 39720f%=file%:PROCsdfile(I%):a%(file%)=-T%:s%(file%)=-2*(T%<>0) 39730PROCactlink(T%):PROCforcecard:PROCsdfile(f%) 39740ENDIF:NEXT:ENDPROC 39750 39760DEFPROCdelcard:LOCALT%:IFFNreadonly:PROCbuzz1:ENDPROC 39770SYSswi%,sd23_%TOT%:SYSswi%,delrec_%,-1:PROCvalidrec 39780IFFNcuridx>0PROCforcecardsrep(1,FNv_(16)):ELSEPROCforcecardsrep(T%,T%) 39790ENDPROC 39800 39810DEFPROCrmvcard:LOCALT%,B%:T%=FNv_(11):IFFNdeadfile(-1):ENDPROC 39820IFT%>31:B%=-1:T%=T%AND31 39830SYSswi%,sd37_%,T%TOG% 39840SYSswi%,sd34_%,B%,-1TOG% 39850SYSswi%,sd37_%TOG% 39860PROCforcecardrep:PROCvalidrec:ENDPROC 39870 39880DEFPROCfinfo(f%) 39890IFFNdeadfile(%1111111101111111):ENDPROC 39900LOCALL%,T$,T%:T%=menufield%:dialreason%=f% 39910w_finf%=FNcrwind(tw_finf%):PROCgetw(w%(file%,0)):SYSswi%,sd17_%,1,T%,sd$TOG% 39920L%=G%:SYSswi%,sd17_%,9,T%,sd$TOG% 39930T$=$sd%:SYSswi%,sd17_%,10,T%,sd$TOG% 39940SYSswi%,sd17_%,4,T%,sd$TOG% 39950PROCunselall(w_finf%):PROCseti(w_finf%,5,T$) 39960PROCseti(w_finf%,2,STR$T%):PROCseti(w_finf%,20,STR$L%) 39970IFINSTR($sd%,"K"):PROCseli(w_finf%,6) 39980IFG%AND8:PROCseli(w_finf%,7) 39990IFG%AND128:PROCseli(w_finf%,8) 40000IFG%AND64:PROCseli(w_finf%,9) 40010G%=G%AND7:CASEG%OF 40020WHEN0:PROCseli(w_finf%,11) 40030WHEN7:PROCseli(w_finf%,10):G%=0 40040OTHERWISE:PROCseli(w_finf%,12) 40050ENDCASE:PROCseti(w_finf%,13,STR$G%) 40060IFNOTf%THEN 40070exi0%=-1:exi1%=-1:RESTORE40120 40080FORT%=0TO6:READL%:PROCiset(w_finf%,L%,&40F000,0):NEXT 40090ELSE:exi0%=2:exi1%=20 40100ENDIF 40110PROCdialogue(w_finf%):ENDPROC 40120DATA6,18,20,21,2,3,4 40130 40140DEFFNnote(T%,I%):LOCALq%:q%=workbuf%:=$FNtia(tw%(T%,6),I%) 40150 40160DEFPROCnote(T%,I%,T$):LOCALq%:q%=workbuf% 40170IFw%(T%,6)>0PROCseti(w%(T%,6),I%,T$)ELSE$FNtia(tw%(T%,6),I%)=LEFT$(T$,80) 40180ENDPROC 40190 40200DEFFNmacln(T%,I%):IFI%>29:="" 40210LOCALq%:q%=workbuf%:=$FNtia(tw%(T%,7),I%) 40220 40230DEFPROCmacln(T%,I%,T$):LOCALq%:q%=workbuf%:IFI%>29:ENDPROC 40240IFw%(T%,7)>0PROCseti(w%(T%,7),I%,T$)ELSE$FNtia(tw%(T%,7),I%)=LEFT$(T$,80) 40250ENDPROC 40260 40270DEFPROCloadnotes:LOCALI%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 40280WHILENOTEOF#T%ANDI%<19:PROCnote(file%,I%,GET$#T%) 40290I%+=1:ENDWHILE:CLOSE#T%:WHILEI%<19:PROCnote(file%,I%,""):I%+=1:ENDWHILE 40300PROCnoscrap:PROCnewfn(f_np$):PROCnewnotes:ENDPROC 40310 40320DEFPROCloadmacro:LOCALI%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 40330WHILENOTEOF#T%ANDI%<30:PROCmacln(file%,I%,GET$#T%) 40340I%+=1:ENDWHILE:CLOSE#T%:WHILEI%<30:PROCmacln(file%,I%,""):I%+=1:ENDWHILE 40350PROCnoscrap:PROCnewfn(f_mc$):PROCnewnotes:ENDPROC 40360 40370DEFPROCchecksetup 40380LOCALT$,T%:T$=FNzts(q%+44):T%=FNsetuptype(T$):IFT%<0PROCerr(50) 40390PROCwtof(mh%):IFfile%<0:IFmh%=dialogue%:file%=dialfile% 40400IFfile%<0ANDT%<>0PROCerr(49) 40410PROCdataloadack:file$=T$:IFT%=7PROCerr(63) 40420PROCstop(28,FNsetupdesc(T%),rl$+"load setup ?",file%):ENDPROC 40430 40440DEFPROCloadsetup:LOCALT%,F%,I%,A%,B%,X%,Y%,Z%,T$ 40450T%=FNsetuptype(file$):IFT%<0:PROCerr(50) 40460CASET%OF 40470WHEN0:PROCPDload 40480WHEN1,4 40490IFfile%<0PROCerr(49) 40500r%(file%)=3:PROCmakerep(file%) 40510F%=OPENIN(file$):IFF%=0:ENDPROC 40520LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#F%:PROCerr(0) 40530IFT%=1THEN 40540INPUT#F%,T$:INPUT#F%,ll%(file%,4),ll%(file%,0),ll%(file%,3),ll%(file%,1),ll%(file%,5),ll%(file%,2) 40550lf%(file%,15)=0:FORI%=0TO14:INPUT#F%,A%,B%,X%,Y%,Z%:lf%(file%,I%)=B%OR(A%<<2)OR((X%AND1)<<4)OR((Z%AND1)<<5)OR((Y%AND1)<<6):NEXT 40560ELSE 40570PTR#F%=5:FORI%=0TO5:INPUT#F%,ll%(file%,I%):NEXT 40580FORI%=0TO15:INPUT#F%,lf%(file%,I%):NEXT 40590IFNOTEOF#F%:INPUT#F%,ll%(file%,6),ll%(file%,7) 40600ENDIF 40610CLOSE#F%:RESTOREERROR:IFw_label%>0:PROCrset3i 40620PROCrext:PROCforcerep:PROCnewfn(f_la$) 40630WHEN2,5 40640IFfile%<0PROCerr(49) 40650r%(file%)=4:PROCmakerep(file%) 40660F%=OPENIN(file$):IFF%=0:ENDPROC 40670LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#F%:PROCerr(0) 40680IFT%=2THEN 40690INPUT#F%,T$,A%,B%,X%,Y%,T$ 40700PROCflg(f_wupp%,B%):PROCflg(f_wspc%,X%):PROCflg(f_wbnk%,Y%) 40710FORI%=0TO14:INPUT#F%,w$(file%,I%):NEXT 40720ELSE 40730PTR#F%=5:FORI%=0TO14:INPUT#F%,w$(file%,I%):NEXT:INPUT#F%,wo%(file%) 40740ENDIF 40750CLOSE#F%:RESTOREERROR:IFw_word%>0:PROCrset4i 40760PROCforcerep:PROCnewfn(f_wp$) 40770WHEN3,6 40780Z%=FALSE:IFfile%<0PROCerr(49) 40790r%(file%)=5:PROCmakerep(file%) 40800F%=OPENIN(file$):IFF%=0:ENDPROC 40810LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#F%:PROCerr(0) 40820IFT%=3THEN 40830INPUT#F%,T$ 40840INPUT#F%,p%(file%,2),p%(file%,1),T%,p%(file%,0),p%(file%,3),p%(file%,4) 40850INPUT#F%,T%:PROCflg(f_rejb%,T%<>0):INPUT#F%,T%:PROCflg(f_reja%,T%<>0) 40860INPUT#F%,T%:PROCflg(f_rdsp%,T%<>0):INPUT#F%,T%:PROCflg(f_rtpn%,T%<>0) 40870INPUT#F%,T%:PROCflg(f_rbpn%,T%<>0):INPUT#F%,T%:PROCflg(f_rpdt%,T%<>0) 40880INPUT#F%,T%:PROCflg(f_rtpg%,T%<>0) 40890INPUT#F%,T%:PROCflg(f_rtsu%,T%<>0ANDNOTFNflg(f_rtpg)) 40900FORI%=0TO7:INPUT#F%,p$(file%,I%):NEXT 40910I%=0:REPEAT:INPUT#F%,c$(file%,I%,0),c$(file%,I%,1):column%=I% 40920INPUT#F%,T%:PROCsetcol(T%,3,8):INPUT#F%,T%:PROCsetcol(T%,255,0) 40930INPUT#F%,T%:PROCsetcol(T%,3,10):INPUT#F%,T%:PROCsetcol(T%,3,17) 40940INPUT#F%,T%:PROCsetcol(T%,7,14):INPUT#F%,T%:PROCsetcol(T%<>0,1,20) 40950INPUT#F%,T%:PROCsetcol(T%,7,21):I%+=1:UNTILI%>30ORI%>maxcol% 40960IFI%<=maxcol%:FORI%=I%TOmaxcol%:PROCr_clearcol(I%):NEXT 40970ELSE 40980PTR#F%=5:FORI%=0TO7:INPUT#F%,p$(file%,I%):NEXT 40990FORI%=0TO4:INPUT#F%,p%(file%,I%):NEXT 41000INPUT#F%,T%:PROCflgm(f_reps%,T%) 41010I%=0:REPEAT:INPUT#F%,c%(file%,I%),c$(file%,I%,0),c$(file%,I%,1) 41020I%+=1:UNTILEOF#F%ORI%>maxcol% 41030IFI%<=maxcol%:FORI%=I%TOmaxcol%:PROCr_clearcol(I%):NEXT 41040ENDIF 41050CLOSE#F%:RESTOREERROR 41060PROCrext:PROCforcerep:PROCnewfn(f_rp$) 41070OTHERWISE:PROCerr(50) 41080ENDCASE 41090ENDPROC 41100 41110DEFFNsetuptype(f$) 41120LOCALA%,B%,I%,F%,T%,T$:F%=OPENUP(f$):IFF%=0:=-1 41130LOCALERROR 41140PTR#F%=0:FORI%=1TO4:A%=BGET#F%:B%=(A%<<24)+(B%>>8):NEXT 41150IFB%=&55010001:CLOSE#F%:=0 41160IFB%=&6C72654D:B%=BGET#F%:CLOSE#F%:=B% 41170PTR#F%=0:T%=TRUE:ONERRORLOCAL:RESTOREERROR:T%=FALSE 41180IFT%INPUT#F%,T$ 41190IFT%THEN 41200IFT$="Delta+Mailshot Labels":CLOSE#F%:=1 41210IFT$="Delta+Mailshot Wordpro":CLOSE#F%:=2 41220IFT$="Delta+Mailshot Report":CLOSE#F%:=3 41230ENDIF 41240CLOSE#F%:=-1 41250 41260DEFFNsetupdesc(T%) 41270CASET%OF 41280WHEN0:="Printer Driver" 41290WHEN1:="Old Delta+ Labels" 41300WHEN2:="Old Delta+ Wordpro" 41310WHEN3:="Old Delta+ Report" 41320WHEN4:="MultiStore Labels" 41330WHEN5:="MultiStore Wordpro" 41340WHEN6:="MultiStore Report" 41350WHEN7:="MultiStore Transfer" 41360ENDCASE:="Unrecognised Format" 41370 41380DEFPROCsavesetup 41390BPUT#outfile%,"Merl";:BPUT#outfile%,r%(file%)+1 41400CASEr%(file%)OF 41410WHEN3:PROCsavesla 41420WHEN4:PROCsaveswp 41430WHEN5:PROCsavesrp 41440ENDCASE:ENDPROC 41450 41460DEFPROCsavesla:LOCALI%:FORI%=0TO5:PRINT#outfile%,ll%(file%,I%):NEXT 41470FORI%=0TO15:PRINT#outfile%,lf%(file%,I%):NEXT:PROCnewfn(f_la$) 41480PRINT#outfile%,ll%(file%,6):PRINT#outfile%,ll%(file%,7):ENDPROC 41490 41500DEFPROCsaveswp:LOCALI%:FORI%=0TO14:PRINT#outfile%,w$(file%,I%):NEXT 41510PRINT#outfile%,wo%(file%):PROCnewfn(f_wp$):ENDPROC 41520 41530DEFPROCsavesrp:LOCALI%:FORI%=0TO7:PRINT#outfile%,p$(file%,I%):NEXT 41540FORI%=0TO4:PRINT#outfile%,p%(file%,I%):NEXT 41550PRINT#outfile%,fl%(file%)ANDf_reps%:FORI%=0TOmaxcol% 41560PRINT#outfile%,c%(file%,I%),c$(file%,I%,0),c$(file%,I%,1) 41570NEXT:ENDPROC 41580 41590DEFPROCclearnpad 41600SYS "Wimp_GetCaretPosition",,workbuf% 41610IF!workbuf%=w%(file%,6):SYS"Wimp_SetCaretPosition",-1 41620LOCALI%:FORI%=0TO18:PROCnote(file%,I%,""):NEXT:ENDPROC 41630 41640DEFPROCclearmacro 41650SYS "Wimp_GetCaretPosition",,workbuf% 41660IF!workbuf%=w%(file%,7):SYS"Wimp_SetCaretPosition",-1 41670LOCALI%:FORI%=0TO29:PROCmacln(file%,I%,""):NEXT:ENDPROC 41680 41690DEFFNthisfile(w%,h%):IFw%=dialogue%:IFh%=dialfile%:=TRUE 41700LOCALI%:FORI%=0TOmaxw%:IFw%(h%,I%)=w%:=TRUE 41710NEXT:=FALSE 41720 41730DEFPROCscrsz 41740!workbuf%=4:workbuf%!4=5:workbuf%!8=11:workbuf%!12=12:workbuf%!16=-1 41750SYS"OS_ReadVduVariables",workbuf%,workbuf%+24 41760q%!32=(workbuf%!32)<<(workbuf%!24):q%!36=(workbuf%!36)<<(workbuf%!28) 41770ENDPROC 41780 41790DEFPROCfindfield:LOCALX%,Y%:IFfile%=edfile%:PROCfedit:ENDPROC 41800PROCgetw(w%(file%,0)):SYSswi%,sd17_%,2,menufield%,sd$TOG% 41810X%=G%:SYSswi%,sd17_%,3,menufield%,sd$TOG% 41820Y%=-G%*linegap%-margin%+linegap%/2:X%=X%*16+margin%-8 41830PROCscrollto(X%,Y%,w%(file%,0)):PROCgetw(w%(file%,0)) 41840MOUSETObx%+X%,by%+Y%:PROCfront(w%(file%,0),-1,-1):ENDPROC 41850 41860DEFPROCcompact:IFFNreadonly:PROCbuzz1:ENDPROC 41870PROCselindex(0,0):SYSswi%,compact_% 41880IFr%(file%)<3:PROCrext 41890PROCvalidrec:PROCgraph:PROCforcerep:PROCnodial 41900PROCstop(0,fi$+FNfilename,"Compaction complete!",file%):ENDPROC 41910 41920DEFPROCscrollto(X%,Y%,h%):IFh%<0ENDPROC:ELSEPROCgetw(h%) 41930IFX%>=x0%-bx%ANDX%<=x1%-bx%ANDY%<=y1%-by%-32ANDY%>=y0%-by%ENDPROC 41940scx%=X%-(x1%-x0%)DIV2:scy%=ABSY%-(y1%-y0%)DIV2 41950IFscx%<0scx%=0 41960IFscy%<0scy%=0 41970PROCopen(h%,x0%,y0%,x1%,y1%,scx%,-scy%,bhandle%) 41980ENDPROC 41990 42000DEFPROCfindct:PROCgetct:PROCscrollto(q%!8,q%!12,!q%):ENDPROC 42010 42020DEFPROCstatus:w_status%=FNcrwind(tw_status%) 42030LOCALI%,T%,T$,s$:s$=STRING$(12," ") 42040PROCunselall(w_status%):T%=0:FORI%=0TOmaxf% 42050IFw%(I%,0)>0THEN 42060PROCsdfile(I%):T$=LEFT$(FNfilename+STRING$(11," "),11) 42070T$+=RIGHT$(s$+STR$FNv_(16),10)+RIGHT$(s$+STR$FNv_(17),11)+" " 42080IFl%(file%)>0T$+=FNofilename(l%(file%)-1) 42090IFT%<8:PROCseti(w_status%,T%+15,T$):T%+=1 42100ENDIF 42110NEXT:WHILET%<8:PROCseti(w_status%,T%+15,""):T%+=1:ENDWHILE 42120IFstopboxes%:PROCseli(w_status%,23) 42130IFsound%:PROCseli(w_status%,24) 42140IFshadows%:PROCseli(w_status%,25) 42150IFpix%:PROCseli(w_status%,28) 42160IFsprsz%<=0:PROCshadei(w_status%,28) 42170PROCdialogue(w_status%):ENDPROC 42180 42190DEFPROCcopycard1:IFFNreadonly:PROCbuzz1:ENDPROC 42200IFreason2%=16:PROCselsub(0):PROCselindex(0,0):SYSswi%,add_%TON% 42210LOCALT$,T%,U%,I%,f%,u$ 42220T%=file%:U%=file2%:PROCsdfile(U%):u$=sd$:PROCformstat:f%=FNv_(7) 42230PROCsdfile(T%):FORI%=1TOf% 42240SYSswi%,sd17_%,9,I%,u$TOG% 42250T$=$sd% 42260IFFNfnum(T$)THEN 42270SYSswi%,gfield_%,T$,u$ 42280SYSswi%,pfield_%,T$ 42290ENDIF 42300IFINKEY0=27:I%=f% 42310NEXT:PROCvr(TRUE,s%(file%)=0):PROCgraph:ENDPROC 42320 42330DEFPROCcopycard 42340IFFNdeadfile(%1111111111111110 OR((dragbutton%=64)AND1))ENDPROC 42350LOCALT$,f$,T%:file2%=menufile%:reason2%=dragbutton%:T$="copy" 42360T%=file%:f$=FNfilename:PROCsdfile(file2%):IFreason2%=16:T$="add" 42370PROCstop(21,FNfilename+" � "+f$,rl$+T$+" card ?",T%):ENDPROC 42380 42390DEFPROCconv(RETURN T$) 42400PROCstrip(T$):IFASCT$<>63:ENDPROC 42410T$=FNsu(MID$(T$,2)):LOCALT%,Q%,A%,A$,B$ 42420IFLEFT$(T$,4)="THE "T$=FNs(MID$(T$,5)) 42430PROCremove(T$,"#"):PROCremove(T$,"@") 42440LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(18) 42450PROCqbscan(T$,Q%,A%):IFQ%PROCerr(10):ELSEIFA%PROCerr(11) 42460T%=INSTR(T$," "):IFT%<2PROCerr(19) 42470A$=LEFT$(T$,T%-1):IFT%>5A$=LEFT$(T$,4) 42480T$=MID$(T$,T%+1) 42490T%=LENT$:Q%=32:IFASCRIGHT$(T$)=34:Q%=34:T%-=1 42500REPEAT:IFT%<1PROCerr(19) 42510T%-=1:UNTILASCMID$(T$,T%+1)=Q% 42520$sd%=FNsu(LEFT$(T$,T%)):T$=MID$(T$,T%+2):IFQ%=34:T$=LEFT$(T$) 42530B$="" 42540IFLEFT$($sd%,5)="SOUND":B$="~=" 42550IFLEFT$($sd%,7)="CONTAIN":B$="=":T$="*"+T$+"*" 42560IFINSTR($sd%,"EQU")>0:B$+="=" 42570IFINSTR($sd%,"IS")>0:B$="="+B$ 42580IFINSTR($sd%,"LESS")>0:B$="<"+B$ 42590IFINSTR($sd%,"GREA")>0:B$=">"+B$ 42600IFINSTR($sd%,"IS")>0:B$=LEFT$(B$):IFB$="":B$="=" 42610IFLENB$<1ORLENB$>2:PROCerr(19) 42620IFRIGHT$(B$)="~":B$=LEFT$(B$)+"=" 42630SYSswi%,sd17_%,4,A$,sd$TOG% 42640IF(G%AND7)=7:T$="@"+A$+B$+""""+FNs(T$)+"""":ELSET$="#"+A$+B$+STR$VALT$ 42650IFINSTR($sd%,"NOT"):T$="NOT("+T$+")" 42660ENDPROC 42670 42680DEFPROCremove(RETURN T$,t$):LOCALI% 42690REPEATI%=INSTR(T$,t$):IFI%:T$=LEFT$(T$,I%-1)+MID$(T$,I%+1) 42700UNTILI%=0:ENDPROC 42710 42720DEFPROCdomacro:IFFNdeadfile(%1111111101101101):ENDPROC 42730DEFPROCdomacro1 42740LOCALa%,b%,c%,d%,e%,f%,g%,h%,i%,j%,k%,l%,m%,n%,a$,b$,t1%,t2%,t3%,t4% 42750LOCAL@%,K%,J%,x%,A$,T$,p$,c$ 42760t1%=t%(file%,0):t2%=t%(file%,1):t3%=t%(file%,2):t4%=t%(file%,3) 42770p$="":a$="":b$="":er%=0 42780LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(20) 42790FORer%=0TO29 42800c$=$FNtia(tw%(file%,7),er%) 42810WHILEc$>"" 42820*fx229 42830A$=c$:IFINSTR(c$,":"):A$=LEFT$(c$,INSTR(c$,":")-1) 42840CASE TRUE OF 42850WHEN 42=ASCA$:$sd%=p$:PROCoscli(MID$(c$,2)):p$=$sd% 42860WHENLEFT$(A$,2)="IF" 42870A$=MID$(A$,3):K%=INSTR(A$,"GO"):IFK%=0K%=-INSTR(A$,"THEN") 42880IFK%=0PROCerr(21)ELSE 42890T$=LEFT$(A$,ABSK%-1):IFmacu%PROCupplit(T$) 42900IFFNev1(T$)THEN 42910IFK%>0THEN 42920U%=FNev1(MID$(A$,K%+2)):IFU%<1ORU%>30PROCerr(22) 42930er%=U%-2:c$="" 42940ELSE 42950c$=":"+FNs(MID$(c$,ABSK%+6)) 42960ENDIF 42970ELSE 42980c$="" 42990ENDIF 43000WHENLEFT$(A$,3)="a$=":a$=FNev5(MID$(A$,4)) 43010WHENLEFT$(A$,3)="b$=":b$=FNev5(MID$(A$,4)) 43020WHENLEFT$(A$,4)="PASS":p$=FNev5(MID$(A$,5)) 43030WHENLEFT$(A$,4)="END":er%=999:c$="" 43040WHENLEFT$(A$,3)="REM":c$="" 43050WHENINSTR(A$,"%=")>0:x%=INSTR(A$,"%=") 43060IFx%=3ANDLEFT$(A$,1)="t"THEN 43070J%=VALMID$(A$,2,1):IFJ%<1ORJ%>4PROCerr(33) 43080t%(file%,J%-1)=FNev1(MID$(A$,x%+2)) 43090t1%=t%(file%,0):t2%=t%(file%,1):t3%=t%(file%,2):t4%=t%(file%,3) 43100ELSE 43110IFASCMID$(A$,x%-1)<ASC"a"ORASCMID$(A$,x%-1)>ASC"n"PROCerr(23) 43120PROCsetvar(ASCA$-ASC"a",FNev1(MID$(A$,x%+2))) 43130ENDIF 43140WHENLEFT$(A$,1)="@"ORLEFT$(A$,1)="#":x%=INSTR(A$,"="):PROCsetfield 43150WHENLEFT$(A$,1)="^":x%=INSTR(A$,"="):PROCsetsub 43160ENDCASE 43170IFINSTR(c$,":")c$=MID$(c$,INSTR(c$,":")+1):ELSEc$="" 43180*fx229,1 43190ENDWHILE 43200NEXT 43210ENDPROC 43220 43230DEFPROCsetfield:IFFNreadonly:PROCbuzz1:ENDPROC 43240LOCALT$,exp$,U%,@%,A%,t:exp$=A$ 43250IFx%=0PROCerr(24):ELSE:IFx%<3PROCerr(25) 43260T$=MID$(exp$,2,x%-2):SYSswi%,sd17_%,4,T$TOG%:G%=G%AND7:IFG%=0:A%=&100000A:ELSEA%=&102000A+G%*256 43270U%=FALSE:A$=FNx(MID$(exp$,x%+1)):LOCALERROR 43280ONERRORLOCAL:RESTOREERROR:@%=&90A:U%=TRUE:IFERR<>6:PROCerr(0) 43290IFU%THEN 43300$sd%=FNev(A$,TRUE,FALSE) 43310ELSE 43320t=FNev(A$,TRUE,FALSE):@%=A%:$sd%=STR$t:@%=&90A 43330ENDIF 43340IFNOTU%:RESTOREERROR 43350T$=MID$(exp$,2,x%-2) 43360SYSswi%,pfield_%,T$ 43370ENDPROC 43380 43390DEFPROCsetsub:LOCALT$:IFx%=0PRCerr(26):ELSEIFx%<3PROCerr(27) 43400T$=MID$(A$,2,x%-2):T$=FNsu(LEFT$(T$,4)):a%=FNsubnum(T$) 43410IFa%<=0PROCerr(28):ELSEPROCzfound:IFmacu%PROCupplit(A$) 43420PROCsubbyte(a%,FNev1(MID$(A$,x%+1))):ENDPROC 43430 43440DEFPROCoscli(T$):IFASCT$=42:OSCLIT$:ENDPROC 43450LOCALI%,J%:SYS"Wimp_CommandWindow",1 43460PROCnormpoint:mode%=MODE:MODE12 43470*fx229 43480IFT$=""THEN 43490PROCnovars 43500LOCALERROR 43510ONERRORLOCALIFERR=17ANDT$="":PROCendoscli:ENDPROC:ELSEREPORT:PRINT 43520REPEATT$="":INPUTLINE"*"T$ 43530CASE TRUE OF 43540WHEN ASCT$=63ANDFNv_(1)=0:PRINTEVAL(MID$(T$,2)) 43550WHEN ASCT$=63ANDFNv_(1)>0:PRINTFNev(MID$(T$,2),0,0) 43560OTHERWISEOSCLIT$ 43570ENDCASE 43580UNTILT$="" 43590RESTOREERROR 43600ELSE 43610LOCALERROR 43620ONERRORLOCAL:RESTOREERROR:PROCendoscli:PROCerr(0) 43630TIME=0:OSCLIT$:SYS"OS_Byte",&86TO,I%,J% 43640IFTIME<150ANDI%+J%<>0PRINT''"Press a key... ";:PROCwaitkey 43650ENDIF 43660PROCendoscli:ENDPROC 43670 43680DEFPROCendoscli 43690*fx229,1 43700SYS"Wimp_CommandWindow",-1 43710SYS"Wimp_SetMode",mode%:OFF:PROCforce(-1) 43720ENDPROC 43730 43740DEFPROCemacro:IFFNdeadfile(%1111111101111111):ENDPROC 43750IFNOTFNflg(f_macb%):PROCdomacro 43760PROCforcecardrep:PROCchkmv:PROCvalidrec:ENDPROC 43770 43780DEFPROCbmacro 43790LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCflg(f_macb%,FALSE):PROCshowmac:PROCforcecardrep:PROCvalidrec:PROCerr(0) 43800PROCdomacro:PROCchkmv:PROCforcecardrep:ENDPROC 43810 43820DEFPROCfedit:IFFNreadonly:PROCbuzz1:ENDPROC 43830IFfile%<>edfile%:IFFNdeadfile1(%1111111101011111):PROCbuzz:ENDPROC 43840IFfile%<>edfile%ORedrep%:PROCendedit 43850IFedfile%>=0PROCedited(TRUE) 43860PROCfieldsz(menufield%):SYSswi%,sd17_%,9,menufield%,sd$TOG% 43870SYSswi%,sd17_%,1,$sd%TOG% 43880!q%=w%(file%,0):q%!4=tx0%:q%!8=ty0%:q%!12=tx1%:q%!16=ty1% 43890q%!20=&700F121:q%!24=edbuf%:q%!28=-1:q%!32=G%+1:SYSswi%,sd17_%,4,$sd%TOG% 43900IF(G%AND7)<>7:q%!20=q%!20OR512:q%!28=edval% 43910$edbuf%=FNs(FNgfield(menufield%)) 43920SYS"Wimp_CreateIcon",,q% TO edicon% 43930PROCiconupd(w%(file%,0),edicon%):PROCsetct(w%(file%,0),edicon%,LEN$edbuf%) 43940SYSswi%,sd23_%TON% 43950edfile%=file%:edfield%=menufield%:edrec%=N%:edrep%=FALSE:ENDPROC 43960 43970DEFPROCendfedit:IFedfile%<0:ENDPROC 43980LOCALf%:f%=file% 43990PROCsdfile(edfile%):PROCedited(FALSE):IFf%>=0PROCsdfile(f%) 44000edfile%=-1:edfield%=-1:edicon%=-1:edrec%=-1:edx%=-1:edrep%=FALSE:ENDPROC 44010 44020DEFPROCedited(T%):LOCALT$ 44030IFpix%IFFNpicfield(edfield%):PROCupdatefield(edfield%) 44040IFT%PROCsetct(w%(file%,0),-1,-1) 44050PROCsetedfield:ENDPROC 44060 44070DEFPROCsetedfield1:LOCALT$,T%:$sd%=$edbuf% 44080PROCstrip1:WHILENOTINKEY-3AND(RIGHT$($sd%)="�"ORRIGHT$($sd%)="�") 44090$sd%=LEFT$($sd%):ENDWHILE:$edbuf%=$sd% 44100SYSswi%,grec_%,edrec%TON% 44110SYSswi%,sd17_%,9,edfield%,sd$TOG% 44120T$=$sd%:SYSswi%,gfield_%,T$ 44130PROCstrip1:IF$sd%<>$edbuf%THEN 44140SYSswi%,sd30_%,-1TOG% 44150T%=FNv_(14):$sd%=$edbuf%:SYSswi%,pfield_%,T$ 44160SYSswi%,locate_%,T%TOD% 44170SYSswi%,sd23_%TON% 44180PROCchkmv1(edrec%,N%) 44190ENDIF 44200IFw%(file%,3)>0:PROCsd35:IFG%:PROCforcecardsrep(FNv_(15),FNv_(15)) 44210ENDPROC 44220 44230DEFPROCsetedfield2:PROCsetedfield1 44240IFedicon%>=0:PROCdelicon(w%(file%,-3*edrep%),edicon%):edicon%=-1 44250ENDPROC 44260 44270DEFPROCsetedfield:PROCsetedfield2 44280PROCupdatefield(edfield%):ENDPROC 44290 44300DEFPROCstrip1:IF$sd%="":ENDPROC 44310LOCALT%:T%=?sd%:?sd%=42:SYSswi%,strip_% 44320IF?sd%=13sd%?1=13 44330?sd%=T%:IF$sd%=" "$sd%="" 44340ENDPROC 44350 44360DEFPROCendedit:IFedfile%<0:ENDPROC 44370LOCALf%:f%=file%:PROCsdfile(edfile%):PROCendfedit 44380IFFNv_(15)>0THEN 44390IFFNflg(f_mace%):PROCdomacro:PROCchkmv 44400PROCvalidlink 44410ENDIF 44420IFf%>=0:PROCsdfile(f%) 44430ENDPROC 44440 44450DEFPROCedrep(X%,r%):IFFNreadonly:PROCbuzz1:ENDPROC 44460LOCALd%,f%,Y%:d%=FNv_(14) 44470IFfile%<>edfile%:IFFNdeadfile1(%1111111101011111):PROCbuzz:ENDPROC 44480IFfile%<>edfile%ORNOTedrep%:PROCendedit 44490IFedfile%>=0THEN 44500SYSswi%,grec_%,edrec%TON% 44510PROCsetct(w%(file%,3),-1,0):PROCsetedfield2:PROCupdatefieldrep(edfield%) 44520ENDIF 44530SYSswi%,grec_%,r%TON% 44540PROCvalidaterec1:IFs%(file%)<>0THEN 44550edfile%=-1:edfield%=-1:edicon%=-1:edrec%=-1:edrep%=FALSE:edx%=-1:ENDPROC 44560ENDIF 44570r%=FNv_(15):PROCsrfield(X%,f%):SYSswi%,sd17_%,1,f%TOG% 44580tx0%=margin%+(11+X%)*16-8:tx1%=tx0%+G%*16+8 44590ty0%=-margin%-(FNv_(15)+2)*linegap%+8:ty1%=ty0%+linegap% 44600!q%=w%(file%,3):q%!4=tx0%:q%!8=ty0%:q%!12=tx1%:q%!16=ty1% 44610q%!20=&700F121:q%!24=edbuf%:q%!28=-1:q%!32=G%+1:SYSswi%,sd17_%,4,f%TOG% 44620IF(G%AND7)<>7:q%!20=q%!20OR512:q%!28=edval% 44630PROCcheckformat(f%):SYSswi%,gfield_%,f%:SYSswi%,strip_%:$edbuf%=$sd% 44640SYS"Wimp_CreateIcon",,q% TO edicon% 44650PROCiconupd(w%(file%,3),edicon%):PROCsetct(w%(file%,3),edicon%,LEN$edbuf%) 44660edfile%=file%:edfield%=f%:edx%=X%:edrec%=r%:edrep%=TRUE:ENDPROC 44670 44680DEFPROCcheckformat(T%) 44690LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(72) 44700SYSswi%,sd17_%,9,T%,sdf$:SYSswi%,sd17_%,9,$sd%,sd$:ENDPROC 44710 44720DEFPROCfieldsz1(T%):LOCALgx0%,gy0%,gx1%,gy1% 44730DEFPROCfieldsz(T%) 44740LOCALL%,X%,Y%,G%,t% 44750PROCgetw(w%(file%,0)):SYSswi%,sd17_%,1,T%,sd$TOG% 44760L%=G%:SYSswi%,sd17_%,2,T%,sd$TOG% 44770X%=G%:SYSswi%,sd17_%,3,T%,sd$TOG% 44780SYS"OS_ReadModeVariable",-1,5 TO ,,t% 44790ty0%=(-G%*linegap%-margin%)ANDNOT((1<<t%)-1) 44800ty1%=ty0%+linegap% 44810tx0%=X%*16+margin%-16:tx1%=tx0%+L%*16+2 44820IFpix%THEN 44830IFFNpicfield(T%)THEN 44840LOCALT$,t$,W%,H%,M%,A% 44850SYSswi%,sd17_%,9,T%,sd$TOG% 44860SYSswi%,gfield_%,$sd% 44870SYSswi%,strip_% 44880t$=$sd%:tx1%=tx0%+16*L%:ty0%=ty1%-(tx1%-tx0%) 44890IF$sd%>""THEN 44900T$=FNloadspr($sd%):IFT$>""THEN 44910SYS"OS_SpriteOp",&128,sprbuf%,T$TO,,,W%,H%,,M% 44920SYS"OS_ReadModeVariable",M%,4 TO,,A%:W%=W%<<A% 44930SYS"OS_ReadModeVariable",M%,5 TO,,A%:H%=H%<<A% 44940t%=INSTR(t$,"{"):IFt%>0THEN 44950t$=MID$(t$,t%+1):t%=INSTR(t$,"}"):IFt%>0t$=LEFT$(t$,t%-1) 44960X%=16*VALt$:t%=INSTR(t$,","):IFt%Y%=linegap%*VALMID$(t$,t%+1) 44970IFX%=0ANDY%=0THEN 44980X%=W%:Y%=H%:IFX%>L%*16ORY%>L%*16THEN 44990IFX%>Y%:X%=L%*16:Y%=0:ELSEY%=L%*16:X%=0 45000ENDIF 45010ENDIF 45020IFY%=0:Y%=X%*H%/W%-1 45030IFX%=0:X%=Y%*W%/H%-1 45040tx1%=tx0%+X%:ty0%=ty1%-Y% 45050ELSE 45060IFW%>H%ty0%=ty1%-H%/W%*(tx1%-tx0%)-1:ELSEtx1%=tx0%+W%/H%*(ty1%-ty0%)-1 45070ENDIF 45080ENDIF 45090ENDIF 45100IFtx1%<tx0%+30tx1%=tx0%+30 45110IFty0%>ty1%-30ty0%=ty1%-30 45120ENDIF 45130ENDIF 45140ENDPROC 45150 45160DEFPROCfedit2(T%,t%) 45170PROCformstat:REPEAT:T%+=t%:t%=SGNt% 45180F%=FNv_(7):WHILET%>F%:T%-=F%:ENDWHILE 45190WHILET%<1:T%+=F%:ENDWHILE 45200SYSswi%,sd17_%,4,T%,sd$TOG% 45210UNTIL(G%AND64)=0ORT%=edfield% 45220menufield%=T%:PROCfedit:ENDPROC 45230 45240DEFPROCupdatefield(T%):LOCALX%,L%:PROCfieldsz(T%) 45250!q%=w%(file%,0):q%!4=tx0%:q%!8=ty0%:q%!12=tx1%:q%!16=ty1%:PROCredraw(TRUE) 45260DEFPROCupdatefieldrep(T%):LOCALX%,L% 45270IFr%(file%)=1ANDw%(file%,3)>0THEN 45280SYSswi%,sd66_%,T%TOG% 45290X%=G%+1:IFX%>0THEN 45300SYSswi%,sd17_%,1,T%TOG% 45310L%=G%:SYSswi%,sd17_%,4,T%TOG% 45320IF(G%AND7)<>7:L%+=2 45330tx0%=margin%+(11+X%)*16-8:tx1%=tx0%+L%*16+8 45340ty0%=-margin%-(FNv_(15)+2)*linegap%+8:ty1%=ty0%+linegap% 45350!q%=w%(file%,3):q%!4=tx0%:q%!8=ty0%:q%!12=tx1%:q%!16=ty1%:PROCredraw(TRUE) 45360ENDIF 45370ELSE 45380PROCforcecardrep 45390ENDIF 45400ENDPROC 45410 45420DEFPROCadd:IFFNreadonly:PROCbuzz1:ENDPROC 45430IFFNdeadfile(%1111111111011110):ENDPROC 45440LOCALf%:f%=file%:PROCendedit:PROCsdfile(f%):SYSswi%,add_%TON% 45450PROCrext:PROCselsub(0):PROCnofilt:PROCformstat:edfield%=FNv_(7) 45460PROCsdfile(f%):PROCvalidrec:PROCgraph:PROCfedit2(0,1):ENDPROC 45470 45480DEFPROCshowdef:IFFNdeadfile(%11111111111111110):ENDPROC 45490SYSswi%,grec_%,0TON% 45500PROCnewcard(FALSE,s%(file%)=0):ENDPROC 45510 45520DEFFNshowbranch:PROCreadpointer:IFmb%<>1ORmi%<>-3:=FALSE 45530LOCALT$,t$:T$=fn$(file%):t$=FNleaf(T$):IFt$=T$:=FALSE 45540OSCLI"*filer_opendir "+LEFT$(T$,LENT$-LENt$-1):=TRUE 45550 45560DEFPROCreadws:LOCALT$,T%,I%,c% 45570c%=FNhdbyte1(53):IFc%<>id_bbc%ANDc%<>id_wcia%ANDc%<>id_exb%:ENDPROC 45580SYSswi%,sd24_% 45590IFc%=id_exb%PROCreadexbws:ENDPROC 45600r$(file%)=FNgs:FORI%=0TO18:PROCnote(file%,I%,LEFT$(FNgs,69)):NEXT 45610e$(file%)=LEFT$(FNgs,70) 45620PROCflg(f_rspc%,FNgb):PROCflg(f_rupp%,FNgb) 45630PROCflg(f_sspc%,FNgb2):PROCflg(f_supp%,FNgb2) 45640T%=FNv_(7)+5:IFT%>30ORc%=id_wcia%T%=30 45650FORI%=0TOT%:PROCmacln(file%,I%,FNgs):NEXT 45660SYSswi%,sd25_%TOG% 45670IFG%=11:PROCflg(f_macb%,TRUE):ELSEIFG%:PROCflg(f_mace%,TRUE) 45680st%(file%,0)=0:st%(file%,1)=0:st%(file%,2)=TIME/100 45690ENDPROC 45700 45710DEFPROCreadexbws:LOCALI%,T% 45720FORI%=0TO18:PROCnote(file%,I%,FNgs):NEXT 45730FORI%=0TO29:PROCmacln(file%,I%,FNgs):NEXT 45740FORI%=0TO23:d$(file%,I%)=FNgs:NEXT:f$(file%)=FNgs:fx$(file%)=FNgs 45750e$(file%)=FNgs:FORI%=0TO14:w$(file%,I%)=FNgs:NEXT:wo%(file%)=FNgw(0) 45760r%(file%)=FNgw(0) 45770fl%(file%)=(fl%(file%)ANDNOTf_save%)OR(FNgw(f_dflt%)ANDf_save%) 45780FORI%=0TO3:t%(file%,I%)=FNgw(0):NEXT:o$(file%)=FNgs:o%(file%,0)=FNgw(0) 45790r$(file%)=FNgs:sr$(file%)=FNgs:l$(file%)=FNgs:lk$(file%)=FNgs 45800lx$(file%)=FNgs 45810FORI%=0TO5:ll%(file%,I%)=FNgw(0):NEXT 45820FORI%=0TO15:lf%(file%,I%)=FNgw(0):NEXT 45830FORI%=0TO4:p%(file%,I%)=FNgw(0):NEXT:FORI%=0TO7:p$(file%,I%)=FNgs:NEXT 45840T%=FNgw(0):FORI%=0TOT% 45850IFI%<=maxcol%THEN 45860c$(file%,I%,0)=FNgs:c$(file%,I%,1)=FNgs:c%(file%,I%)=FNgw(0) 45870ELSE 45880$sd%=FNgs:$sd%=FNgs:!sd%=FNgw(0) 45890ENDIF 45900NEXT 45910st%(file%,0)=VALFNgs:st%(file%,1)=VALFNgs:st%(file%,2)=TIME/100 45920ENDPROC 45930 45940DEFPROCwritews:IFFNreadonly:ENDPROC 45950LOCALT$,I%,c% 45960c%=FNhdbyte(&35):IFc%<>id_bbc%ANDc%<>id_wcia%ANDc%<>id_exb%:ENDPROC 45970SYSswi%,sd24_% 45980IFc%=id_exb%:PROCwriteexbws:ENDPROC 45990$sd%=r$(file%):SYSswi%,sd28_% 46000FORI%=0TO18:$sd%=FNnote(file%,I%):SYSswi%,sd28_%:NEXT:$sd%=e$(file%):SYSswi%,sd28_% 46010PROCwsb(FNflg(f_rspc%)):PROCwsb(FNflg(f_rupp%)) 46020PROCwsb(FNflg(f_sspc%)):PROCwsb(FNflg(f_supp%)) 46030T%=FNv_(7)+5:IFT%>30ORc%=id_wcia%T%=30 46040FORI%=0TOT%:$sd%=FNmacln(file%,I%):SYSswi%,sd28_%:NEXT 46050T%=0:IFFNflg(f_mace%):T%=1:ELSEIFFNflg(f_macb%):T%=11 46060SYSswi%,sd26_%,T% 46070ENDPROC 46080 46090DEFPROCwriteexbws:LOCALI% 46100FORI%=0TO18:PROCws(FNnote(file%,I%)):NEXT 46110FORI%=0TO29:PROCws(FNmacln(file%,I%)):NEXT 46120FORI%=0TO23:PROCws(d$(file%,I%)):NEXT:PROCws(f$(file%)):PROCws(fx$(file%)) 46130PROCws(e$(file%)):FORI%=0TO14:PROCws(w$(file%,I%)):NEXT 46140PROCwsw(wo%(file%)):PROCwsw(r%(file%)):PROCwsw(fl%(file%)) 46150FORI%=0TO3:PROCwsw(t%(file%,I%)):NEXT:PROCws(o$(file%)) 46160PROCwsw(o%(file%,0)):PROCws(r$(file%)):PROCws(sr$(file%)) 46170PROCws(l$(file%)):PROCws(lk$(file%)):PROCws(lx$(file%)) 46180FORI%=0TO5:PROCwsw(ll%(file%,I%)):NEXT 46190FORI%=0TO15:PROCwsw(lf%(file%,I%)):NEXT 46200FORI%=0TO4:PROCwsw(p%(file%,I%)):NEXT:FORI%=0TO7:PROCws(p$(file%,I%)):NEXT 46210PROCwsw(maxcol%):FORI%=0TOmaxcol% 46220PROCws(c$(file%,I%,0)):PROCws(c$(file%,I%,1)):PROCwsw(c%(file%,I%)) 46230NEXT:st%(file%,1)+=TIME/100-st%(file%,2):st%(file%,2)=TIME/100 46240st%(file%,0)+=1:PROCws(STR$st%(file%,0)):PROCws(STR$st%(file%,1)) 46250ENDPROC 46260 46270DEFFNgb:SYSswi%,sd25_%TOG%:=(G%=11) 46280DEFFNgb2:SYSswi%,sd25_%TOG%:=(G%<>0) 46290DEFFNgs:SYSswi%,sd27_%:=$sd% 46300DEFPROCws(T$):$sd%=T$:SYSswi%,sd28_% 46310DEFPROCwsb(T%):IFT%SYSswi%,sd26_%,11:ELSESYSswi%,sd26_%,0 46320ENDPROC 46330 46340DEFFNgw(A%):LOCALT%,I%:FORI%=0TO3:SYSswi%,sd25_%TOG% 46350T%=T%OR((G%AND255)<<(I%*8)):NEXT:IFT%=&0d0d0d0dT%=A% 46360=T% 46370 46380DEFPROCwsw(T%):LOCALI%:FORI%=0TO3:G%=T%AND255:SYSswi%,sd26_%,G% 46390T%=(T%>>8):NEXT:ENDPROC 46400 46410DEFFNstatf 46420LOCALT%,I%:I%=14:T%=-1:REPEAT:T%+=1:IFT%>maxf%:=-1 46430IFw%(T%,0)>0:I%+=1 46440UNTILI%=mi%:IFw%(T%,0)>0:PROCsdfile(T%):=T%:ELSE=-1 46450 46460DEFPROCwalign:LOCALX%,Y% 46470IFmenufile%>=0PROCsdfile(menufile%):ELSEENDPROC 46480X%=file%*80+panew%+8:Y%=900-file%*40-paneh% 46490PROCopen(w%(file%,0),X%,Y%,X%+paneh%,Y%+paneh%,0,0,-1) 46500LOCALI%:FORI%=2TOmaxw%:IFw%(file%,I%)>0THEN 46510PROCalign1(file%,I%):PROCopen(w%(file%,I%),tx0%,ty0%,tx1%,ty1%,0,0,-1) 46520ENDIF:NEXT:ENDPROC 46530 46540DEFPROCrlink(T%):IFlinks%=0:ENDPROC 46550LOCALf%,I%:f%=file% 46560FORI%=0TOmaxf%:IFl%(I%)=file%+1PROCrlink1(I%,T%):PROCsdfile(f%) 46570NEXT:ENDPROC 46580 46590DEFPROCrlink1(I%,T%):LOCALT$,file%:file%=I% 46600LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCsdfile(file%):PROCunlink:PROCerr(37) 46610T$=FNev(lx$(file%),TRUE,FALSE):PROCsdfile(file%) 46620G%=0:IFT$>"":PROCdup1(lk$(file%)+"="+T$,0) 46630IFG%=0:SYSswi%,first_%TO,N% 46640IFT%ANDG%<>0:PROCvalidrec:ELSEIFT%:PROCnewcard(TRUE,TRUE) 46650SYSswi%,sd23_%TON% 46660PROCrlink(T%):ENDPROC 46670 46680DEFPROCsetlink:LOCALT$ 46690IFl%(file%)>0T$=FNofilename(l%(file%)-1)ELSET$=lx$(file%) 46700w_rlink%=FNcrwind(tw_rlink%):$FNta(w_rlink%)="Link "+FNfilename 46710PROCseti(w_rlink%,1,T$):PROCseti(w_rlink%,3,lk$(file%)) 46720PROCseti(w_rlink%,5,l$(file%)):PROCdialogue(w_rlink%):ENDPROC 46730 46740DEFPROCunlink:lx$(file%)=FNofilename(l%(file%)-1):SYSswi%,selectkey_%,"?" 46750l%(file%)=-ABSl%(file%):s%(file%)=0:a%(file%)=0 46760links%-=1:PROCvalidrec2:PROCforcecard:PROCforcerep:ENDPROC 46770 46780DEFPROCvalidatelink:LOCALf%:f%=file% 46790WHILEl%(file%)>0:PROCsdfile(l%(file%)-1):ENDWHILE 46800PROCvalidaterec:ENDPROC 46810 46820DEFPROCvalidlink:LOCALf%:f%=file% 46830WHILEl%(file%)>0:PROCsdfile(l%(file%)-1):ENDWHILE 46840PROCvalidrec:PROCsdfile(f%):ENDPROC 46850 46860DEFPROCmatchrep:IFr%(file%)=4:PROCforcerep:ENDPROC 46870IFr%(file%)>2ORw%(file%,3)<1ORs%(file%)<>0ORFNv_(15)=0ENDPROC 46880LOCALh%:h%=1:IFr%(file%)=0h%=FNrht 46890SYSswi%,sd23_%TON% 46900h%=h%*N%-h%:IFr%(file%)=1h%+=2 46910PROCgetw(w%(file%,3)) 46920PROCopen(w%(file%,3),x0%,y0%,x1%,y1%,scx%,-h%*linegap%,bhandle%) 46930ENDPROC 46940 46950DEFFNrsize 46960R%=FNv_(17):CASEr%(file%)OF 46970WHEN0:=R%*FNwd*FNrht 46980WHEN1:=LENFNsrep(1)*(R%+4) 46990WHEN2:=80*R% 47000WHEN3:=R%*ll%(file%,5)*(ll%(file%,0)+ll%(file%,2)+3)*ll%(file%,3) 47010OTHERWISE:=-1 47020ENDCASE:=-1 47030 47040DEFPROCgrabpr 47050IFprinter%>=0:PROCerr(42):ELSEIFpstream%>0:PROCerr(41) 47060pstream%=OPENOUT("Printer:"):IFpstream%=0:PROCerr(41) 47070printer%=file%:ENDPROC 47080 47090DEFPROCreleasepr:IFpstream%>0:CLOSE#pstream% 47100printer%=-2:pstream%=0:ENDPROC 47110 47120DEFPROCpprint1(T$) 47130LOCALERROR 47140ONERRORLOCAL:RESTOREERROR:SYS"Hourglass_Off":OSCLI"fx229,1":PROCerr(0) 47150SYS"Hourglass_On":*fx229 47160BPUT#pstream%,T$; 47170RESTOREERROR:SYS"Hourglass_Off":*fx229,1 47180ENDPROC 47190 47200DEFPROCpprint(T$):PROCpprint1(T$):PROCpnewl:ENDPROC 47210 47220DEFPROCppage(T%):IFpdriver%:PROCpprint1(PDff$):ELSEPROCpnewl:ENDPROC 47230IFNOTmanual%ORNOTT%:ENDPROC 47240!q%=99:$(q%+4)="Please load a new sheet of paper into the printer" 47250SYS "Wimp_ReportError",q%,17:ENDPROC 47260 47270DEFPROCpnewl 47280LOCALERROR 47290ONERRORLOCAL:RESTOREERROR:SYS"Hourglass_Off":OSCLI"fx229,1":PROCerr(0) 47300SYS"Hourglass_On":*fx229 47310IFpterm%>0:BPUT#pstream%,13 47320IFpterm%<>1:BPUT#pstream%,10 47330RESTOREERROR:SYS"Hourglass_Off":*fx229,1 47340ENDPROC 47350 47360DEFPROCdprint1(T$):BPUT#outfile%,T$;:ENDPROC 47370 47380DEFPROCdprint(T$):PROCdprint1(T$):PROCdnewl:ENDPROC 47390 47400DEFPROCofont(T%,O%):IFpdriver%PROCoprint1(PDfont$(T%),O%) 47410ENDPROC 47420 47430DEFPROCdnewl:BPUT#outfile%,"":ENDPROC 47440 47450DEFPROConewl(T%):IFT%:PROCdnewl:ELSEPROCpnewl 47460DEFPROCoprint(T$,T%):IFT%:PROCdprint(T$):ELSEPROCpprint(T$) 47470DEFPROCoprint1(T$,T%):IFT%:PROCdprint1(T$):ELSEPROCpprint1(T$) 47480ENDPROC 47490 47500DEFFNsrep(r%) 47510LOCALERROR 47520ONERRORLOCAL:RESTOREERROR:=" ** "+REPORT$ 47530SYSswi%,sd23_% 47540IFr%=1r%=-2ELSEIFr%=4r%=FNv_(15)ELSEIFr%=5r%=-3 47550SYSswi%,line_%,r%,srx$(file%) 47560IFFNflg(f_srup%):SYSswi%,upper_% 47570=$sd% 47580 47590DEFFNslin(r%) 47600LOCALT$,A$ 47610A$=STRING$(12," ") 47620CASEr%OF 47630WHEN1:IFFNflg(f_stit%)T$=FNsrep(0) 47640WHEN2:IFFNflg(f_sdas%)ANDFNflg(f_stit%)T$=FNsrep(1) 47650WHENFNv_(17)+3:IFFNflg(f_stot%)ANDFNflg(f_sdas%)T$=FNsrep(1) 47660WHENFNv_(17)+4:IFFNflg(f_stot%)T$=FNsrep(5) 47670OTHERWISE:SYSswi%,grec_%,r%-2TON% 47680PROCsd35:A$=RIGHT$(" "+STR$(r%-2),10)+": ":CASEG%OF 47690WHEN1:PROCgcol(0,3):T$="(Not in this subset)" 47700WHEN0:T$=FNsrep(4) 47710OTHERWISE:PROCgcol(0,3):T$="(Deleted Card)" 47720ENDCASE 47730ENDCASE 47740=A$+T$ 47750 47760DEFFNrlin(r%,L%):LOCALt$,a$ 47770a$=STRING$(12," "):SYSswi%,grec_%,r% 47780PROCsd35:a$=RIGHT$(a$+STR$(r%),10)+": ":CASEG%OF 47790WHEN1:PROCgcol(0,3):t$="(Not in this subset)" 47800WHEN0:IFL%>11:t$=FNrlin1 47810OTHERWISE:PROCgcol(0,3):t$="(Deleted Card)" 47820ENDCASE 47830=LEFT$(a$+t$,L%) 47840 47850DEFFNrlin1 47860LOCALERROR:ONERRORLOCAL:RESTOREERROR:=" ** "+REPORT$ 47870=FNev3(rx$(file%),FNflg(f_rspc%),FNflg(f_rupp%),&90A) 47880 47890DEFFNwlin(T%):LOCALt$,T$:t$=RIGHT$("0"+STR$(T%+1),2)+":" 47900LOCALERROR:ONERRORLOCAL:RESTOREERROR:=t$+" ** "+REPORT$ 47910T$=FNs(w$(file%,T%)):IFT$="":=t$ 47920T$=FNs(FNx(T$)):IFFNu(T$)="END":=t$+"----END"+STRING$(73,"-") 47930=t$+LEFT$(FNev3(T$,FNflg(f_wspc%),FNflg(f_wupp%),&90A),80) 47940 47950DEFPROCrepdefault 47960LOCALI%,T% 47970CASEr%(file%)OF 47980WHEN1:PROCstrip(sr$(file%)):IFsr$(file%)=""sr$(file%)=FNfname(1):PROCflg1(f_sspc%ORf_stot%ORf_stit%ORf_sdas%) 47990PROCremove(sr$(file%),"@"):PROCremove(sr$(file%),"#") 48000srx$(file%)=FNx5(sr$(file%)) 48010WHEN2:PROCstrip(r$(file%)):IFr$(file%)="":r$(file%)="@"+FNfname(1) 48020rx$(file%)=FNx6(r$(file%)) 48030WHEN3 48040IFll%(file%,0)<=0THEN 48050RESTORE+1:FORI%=0TO5:READll%(file%,I%):NEXT 48060FORI%=0TO15:lf%(file%,I%)=0:NEXT 48070ENDIF 48080DATA30,4,4,9,2,1 48090WHEN4 48100IFwo%(file%)<0wo%(file%)=0:FORI%=0TO14:w$(file%,I%)="":NEXT:PROCflg0(f_wupp%):PROCflg0(f_wbnk%):PROCflg1(f_wspc%) 48110WHEN5 48120IFp%(file%,0)<=0:p$(file%,0)="":RESTORE+1:FORI%=0TO4:READp%(file%,I%):NEXT 48130IFp$(file%,0)=""THEN 48140PROCflg1(f_reja%ORf_rbpn%ORf_rpdt%) 48150PROCflg0(f_rejb%ORf_rdsp%ORf_rtpn%ORf_rldu%ORf_rlsu%ORf_rtpg%ORf_rtsu%) 48160PROCr_clear:p$(file%,0)="Report on file "+FNfilename 48170T%=0:FORI%=0TOmaxcol%:IFI%<FNv_(7)THEN 48180menufile%=file%:PROCr_setcol(I%+1,I%):PROCdecodecol(I%) 48190IFT%+cwid%<p%(file%,2):T%+=cwid%+1:ELSEPROCr_clearcol(I%):I%=1E9 48200ENDIF 48210NEXT 48220ENDPROC 48230ENDIF 48240DATAdpwid%,4,dpwid%-8,dplen%-6,dplen% 48250ENDCASE 48260ENDPROC 48270 48280DEFPROCrsetup 48290CASEr%(file%)OF 48300WHEN1:PROCrset1 48310WHEN2:PROCexpr(2) 48320WHEN3:PROCrset3 48330WHEN4:PROCrset4 48340WHEN5:PROCrset51 48350ENDCASE:ENDPROC 48360 48370DEFPROCrset1:w_srset%=FNcrwind(tw_srset%) 48380PROCunselall(w_srset%):IFFNflg(f_srup%):PROCseli(w_srset%,0) 48390IFFNflg(f_stot%):PROCseli(w_srset%,1) 48400IFFNflg(f_stit%):PROCseli(w_srset%,7) 48410IFFNflg(f_sdas%):PROCseli(w_srset%,8) 48420ex$=sr$(file%):PROCseti(w_srset%,3,ex$):PROCdialogue(w_srset%):ENDPROC 48430 48440DEFPROCrset2:LOCALT$:T$=FNx6($A%) 48450PROCflg(f_rupp%,u%):PROCflg(f_rspc%,s%):r$(file%)=$A%:rx$(file%)=T$ 48460PROCforcerep:ENDPROC 48470 48480DEFPROCrset3:w_label%=FNcrwind(tw_label%):PROCrset3i 48490PROCdialogue(w_label%):ENDPROC 48500 48510DEFPROCrset3i 48520LOCALI%,J%:RESTORE48540:FORI%=0TO7:READJ% 48530PROCseti(w_label%,J%,STR$ll%(file%,I%)):NEXT:PROClwidth:ENDPROC 48540DATA12,41,23,6,15,19,48,52 48550 48560DEFPROCrset4:w_word%=FNcrwind(tw_word%):PROCrset4i 48570PROCdialogue(w_word%):ENDPROC 48580 48590DEFPROCrset4i 48600LOCALI%:FORI%=0TO14:PROCseti(w_word%,I%,w$(file%,I%)):NEXT 48610PROCunselall(w_word%):RESTORE48680:FORI%=0TO9:READT$ 48620IFT$<>"*"PROCseti(w_word%,I%+30,T$):ELSEPROCloseicon(w_word%,I%+30) 48630NEXT:PROCseli(w_word%,30+wo%(file%)) 48640IFFNflg(f_wspc%):PROCseli(w_word%,40) 48650IFFNflg(f_wupp%):PROCseli(w_word%,41) 48660IFFNflg(f_wbnk%):PROCseli(w_word%,44) 48670ENDPROC 48680DATA ASCII (TSV),View,InterWord,1stWord+,CSV,Pipedream,WordWise+,DIF,*,* 48690 48700DEFPROCrset51:w_rset1%=FNcrwind(tw_rset1%):PROCrset51i 48710PROCdialogue(w_rset1%):ENDPROC 48720 48730DEFPROCrset51i:LOCALT%,I%:T%=w_rset1% 48740PROCunselall(T%):IFFNflg(f_rldu%)PROCseli(T%,36):ELSEIFFNflg(f_rlsu%)PROCseli(T%,37):ELSEPROCseli(T%,35) 48750FORI%=0TO3:PROCseti(T%,I%+1,p$(file%,I%)):NEXT 48760ENDPROC 48770 48780DEFPROCrset52:w_rset2%=FNcrwind(tw_rset2%):PROCrset52i 48790PROCdialogue(w_rset2%):ENDPROC 48800 48810DEFPROCrset52i:LOCALT%,I%:T%=w_rset2% 48820PROCunselall(T%):IFFNflg(f_rtpg%)PROCseli(T%,51):ELSEIFFNflg(f_rtsu%)PROCseli(T%,52):ELSEPROCseli(T%,50) 48830FORI%=0TO3:PROCseti(T%,I%+42,p$(file%,I%+4)):NEXT 48840ENDPROC 48850 48860DEFPROCrset53:w_rset3%=FNcrwind(tw_rset3%):PROCrset53i 48870PROCdialogue(w_rset3%):ENDPROC 48880 48890DEFPROCrset53i:LOCALT%,I%:T%=w_rset3% 48900PROCunselall(T%) 48910IFFNflg(f_rejb%)PROCseli(T%,29) 48920IFFNflg(f_reja%)PROCseli(T%,30) 48930IFFNflg(f_rdsp%)PROCseli(T%,31) 48940IFFNflg(f_rtpn%)PROCseli(T%,32) 48950IFFNflg(f_rbpn%)PROCseli(T%,33) 48960IFFNflg(f_rpdt%)PROCseli(T%,34) 48970RESTORE+1:FORI%=0TO4:READJ%:PROCseti(T%,J%,STR$p%(file%,I%)):NEXT 48980PROCseti(T%,38,STR$FNprwidth):PROCrmargin:ENDPROC 48990DATA7,12,16,26,22 49000 49010DEFPROCsrfield(RETURN X%,RETURN g%) 49020SYSswi%,sd65_%,X%-1TOG%,P% 49030g%=G%:X%=P%+1:ENDPROC 49040 49050DEFPROCsrxnext(RETURN X%,RETURN f%,d%) 49060LOCALL% 49070IFd%>0THEN 49080SYSswi%,sd17_%,1,f%TOG% 49090X%+=G%+1:IFX%>LENFNsrep(1):X%=1 49100ELSE 49110IFX%>1THEN 49120X%-=2:SYSswi%,sd17_%,4,f%TOG% 49130IF(G%AND7)<>7X%-=2 49140ENDIF 49150ENDIF 49160PROCsrfield(X%,f%):ENDPROC 49170 49180DEFPROCasccard 49190LOCALh%,I%,T%:T%=OPENINfile$:IFT%=0:ENDPROC 49200I%=1:h%=FNht:WHILEI%<=h%ANDNOTEOF#T%:$sd%=GET$#T% 49210SYSswi%,sd00_%,sd%,I% 49220I%+=1:ENDWHILE:CLOSE#T%:SYSswi%,sd38_%,255 49230SYSswi%,sd38_% 49240PROCforcecard:PROCnoscrap:ENDPROC 49250 49260DEFPROClwidth:LOCALA%,T%,W%:W%=workbuf% 49270RESTORE15170:FORT%=0TO20STEP4:READA%:W%!T%=VAL$FNia(w_label%,A%):NEXT 49280T%=(!W%+W%!8)*W%!16-W%!8+W%!4:PROCseti(w_label%,26,STR$T%):ENDPROC 49290DATA12,41,23,6,15,19 49300 49310DEFFNlwidth:LOCALh%:h%=file% 49320=ll%(h%,1)+(ll%(h%,0)+ll%(h%,2))*ll%(h%,4)-ll%(h%,2) 49330 49340DEFFNdumlab(L%) 49350LOCALT$,t$,T%:t$=STRING$(ll%(file%,1)," ") 49360T$="["+MID$("���",FNjustl(L%)+1,1)+STR$(FNfontl(L%)+1) 49370IFFNspcl(L%)T$+="S" 49380IFFNuppl(L%)T$+="U" 49390IFFNfixl(L%)T$+="F" 49400T$+="]":T%=ll%(file%,0):IFT%<=LENT$THEN 49410T$=LEFT$(T$,T%) 49420ELSE 49430CASEFNjustl(L%)OF 49440WHEN0:T$+=STRING$(T%-LENT$,"*") 49450WHEN1:T$=STRING$((T%-LENT$)DIV2,"*")+T$:T$+=STRING$(T%-LENT$,"*") 49460WHEN2:T$=STRING$(T%-LENT$,"*")+T$ 49470ENDCASE 49480ENDIF 49490T%=ll%(file%,4):WHILET%>0:T%-=1 49500IFLENt$+LENT$<255t$+=T$ 49510IFLENt$+ll%(file%,2)<255ANDT%>0t$+=STRING$(ll%(file%,2)," ") 49520ENDWHILE:=t$ 49530 49540DEFFNjustl(L%):IFL%>15:=0:ELSE=lf%(file%,L%)AND3 49550DEFFNfontl(L%):IFL%>15:=0:ELSE=(lf%(file%,L%)AND12)>>>2 49560DEFFNspcl(L%):IFL%>15:=FALSE:ELSE=(lf%(file%,L%)AND16)<>0 49570DEFFNuppl(L%):IFL%>15:=FALSE:ELSE=(lf%(file%,L%)AND32)<>0 49580DEFFNfixl(L%):IFL%>15:=FALSE:ELSE=(lf%(file%,L%)AND64)<>0 49590 49600DEFPROClabline(t%,O%) 49610LOCALJ%,K%,b%,f%,h%,i%,j%,l%,g%,w%,w,T$,T%,t:h%=FNht 49620LOCALERROR:ONERRORLOCAL:RESTOREERROR:SYSswi%,sd38_%,0,sd$:PROCerr(0) 49630e%(file%,0)+=1:IFe%(file%,0)>ll%(file%,3):e%(file%,0)=1 49640IFt%=1THEN 49650SYSswi%,sd38_%,42,sd$ 49660ELSE 49670T%=e%(file%,2):b%=FALSE:SYSswi%,grec_%,T%TON% 49680PROCshownum 49690ENDIF 49700IFll%(file%,7):IF(labline%-ll%(file%,6))MODll%(file%,3)=0:IFll%(file%,7)>ll%(file%,3)+ll%(file%,6):IFll%(file%,7)-labline%<ll%(file%,3):WHILElabline%<ll%(file%,7):PROCoprint("",O%):labline%+=1:ENDWHILE:labline%=0 49710IFlabline%=0:IFll%(file%,6):IFll%(file%,6)<=ll%(file%,7)-ll%(file%,3):FORJ%=1TOll%(file%,6):PROCoprint("",O%):labline%+=1:NEXT 49720l%=e%(file%,1) 49730PROCofont(1,O%):PROCoprint1(STRING$(ll%(file%,1)," "),O%) 49740labline%+=1:w=0:FORJ%=1TOll%(file%,4) 49750IF(FNv_(15)>FNv_(17)ANDt%=0)ORb%THEN 49760$sd%="" 49770ELSE 49780K%=l1%(file%,J%-1):REPEAT 49790IFK%>h%$sd%="":ELSESYSswi%,gline_%,K%,sd$ 49800SYSswi%,strip_% 49810IFFNspcl(K%-1):$sd%=FNss($sd%):SYSswi%,strip_% 49820IFFNuppl(K%-1):SYSswi%,upper_% 49830K%+=1:UNTIL$sd%>""ORFNfixl(K%-2)ORK%>h%+1 49840IFFNfixl(K%-2):IFK%-1<>e%(file%,0):$sd%="":K%-=1 49850f%=FNfontl(K%-2)+1:IFf%<1OR$sd%=STRING$(LEN$sd%," "):f%=1 49860t=1:IFpdriver%t=PDcpl%(f%)/PDcpl%(1) 49870w%=(J%*(ll%(file%,0)+ll%(file%,2))-w)*t+.5 49880w+=w%/t:PROCofont(f%,O%):g%=ll%(file%,2)*t+.5:IFg%=0ANDll%(file%,2)>0g%=1 49890PROCppexpand($sd%):j%=FNjustl(K%-2):IFj%=1ORj%=2:SYSswi%,strip_% 49900IFj%=1$sd%=LEFT$($sd%,w%-g%):$sd%=STRING$((w%-g%-LEN$sd%)/2," ")+$sd% 49910IFj%=0ORj%=1:$sd%=LEFT$($sd%,w%-g%):$sd%=LEFT$($sd%+STRING$(w%," ")+$sd%,w%) 49920IFj%=2$sd%=RIGHT$(STRING$(w%-g%," ")+$sd%,w%-g%)+STRING$(g%," ") 49930IFt%=1AND(e%(file%,0)<>ll%(file%,3)OR$sd%<>STRING$(LEN$sd%," "))THEN 49940FORi%=0TOLEN$sd%-g%-1:IFsd%?i%=32:sd%?i%=46 49950NEXT 49960ENDIF 49970IFJ%=ll%(file%,4):$sd%=LEFT$($sd%,LEN$sd%-g%) 49980l1%(file%,J%-1)=K%:PROCoprint1($sd%,O%) 49990l%+=1:IFl%>ll%(file%,5)THEN 50000IFt%=0:PROCsdnext:ELSEIFt%=2:b%=TRUE 50010l%=1 50020ENDIF 50030ENDIF 50040NEXT 50050PROConewl(O%) 50060IFt%=1THEN 50070SYSswi%,sd38_%,0,sd$ 50080IFe%(file%,0)=ll%(file%,3)e%(file%,1)=l%:FORi%=0TOmaxacr%-1:l1%(file%,i%)=1:NEXT 50090ELSE 50100IF(FNv_(15)>FNv_(17)OR(t%=2ANDe%(file%,1)=ll%(file%,5)))ANDe%(file%,0)=ll%(file%,3)THEN 50110IFt%=0ANDO%=FALSE:PROCendact:ELSEe%(file%,2)=-1 50120ELSE 50130IFe%(file%,0)=ll%(file%,3)THEN 50140e%(file%,2)=FNv_(15):e%(file%,1)=l%:FORi%=0TOmaxacr%-1:l1%(file%,i%)=1:NEXT 50150ELSE 50160T%=e%(file%,2):SYSswi%,grec_%,T%TON% 50170ENDIF 50180ENDIF 50190ENDIF 50200ENDPROC 50210 50220DEFFNMakePable(A$,L%)LOCALB$,I%,C%,M%:IFA$="":="" 50230FORI%=1TOLENA$:C%=ASCMID$(A$,I%,1):CASETRUE OF 50240WHENC%<32:IFINKEY-3:B$+=FNs(MID$("NULSOHSTXETXEOTENQACKBELBS TABLF VT FF CR SO SI DLEDC1DC2DC3DC4NAKSYNETBCANEM SUBESCFS GS RS US ",C%*3+1,3)):ELSEB$+=STR$C% 50250WHENC%<127:IFRIGHT$(B$,2)=""",":B$=LEFT$(B$,LENB$-2)+CHR$C%+"""":ELSEB$+=""""+CHR$C%+"""" 50260WHENC%=127:B$+="DEL" 50270OTHERWISE B$+=STR$C% 50280ENDCASE 50290IFI%<>LENA$:B$+=",":M%=-999 50300NEXT:IFM%=-999M%=1:ELSEM%=LENA$ 50310IFM%=L%ORL%=0:=LEFT$(B$,30):ELSE=LEFT$(B$+" ["+STR$L%+"]",30) 50320 50330DEFFNPConv(A$)LOCALW$,B$,C%:Length=0 50340REPEATW$=FNtoken(A$) 50350IFLENW$B$+=FNPC2(W$):C%+=1 50360UNTILW$="":IFC%=1C%=LENB$:ELSEC%=1 50370IFLength<1Length=C% 50380=B$ 50390 50400DEFFNPC2(W$)LOCALA$,A% 50410A$=LEFT$(W$,1):CASETRUE OF 50420WHENA$="""",A$="'":IFRIGHT$(W$)<>A$:ERROR200,"Bad "+A$+" item":ELSE=MID$(W$,2,LENW$-2) 50430WHENA$="&":=CHR$EVALW$ 50440WHENASCA$>47ANDASCA$<58:=CHR$VALW$ 50450WHENA$="[":IFRIGHT$(W$)<>"]":ERROR200,"Bad length specifier":ELSELength=VALMID$(W$,2,LENW$-2):="" 50460ENDCASE:A$=FNlower(W$) 50470A%=INSTR(".nul.soh.stx.etx.eot.enq.ack.bel.bs .tab.lf .vt .ff .cr .so .si .dle.dc1.dc2.dc3.dc4.nak.syn.etb.can.em .sub.esc.fs .gs .rs .us .del.","."+LEFT$(A$+" ",3)+"."):IFA%=32A%=127 50480IFA%=0:=W$ 50490=CHR$(A%DIV4) 50500 50510DEFFNtoken(RETURN A$)LOCALB$,I%,J% 50520A$=FNs1(A$):I%=1:IFASCA$=34ORASCA$=39THEN 50530I%=INSTR(A$,CHR$ASCA$,2):IFI%=0:I%=LENA$ 50540B$=LEFT$(A$,I%):A$=MID$(A$,I%+1) 50550IFASCA$=ASC",":A$=MID$(A$,2):ELSEWHILEASCA$=32:A$=MID$(A$,2):ENDWHILE 50560=B$ 50570ENDIF 50580J%=INSTR(A$," ",I%):I%=INSTR(A$,",",I%):IFI%=0ORI%>J%ANDJ%>0:I%=J% 50590B$=LEFT$(A$,I%-1):A$=MID$(A$,I%+1):IFI%=0:A$="" 50600=FNs1(B$) 50610 50620DEFPROCsavepd 50630LOCALA%,I%,F%:F%=outfile% 50640A%=&55010001:FORI%=1TO4:BPUT#F%,A%:A%=A%>>8:NEXT 50650PROCPDstring(F%,PDname$):PROCPDstring(F%,PDreset$) 50660BPUT#F%,PDfont% 50670IFPDfont%:FORI%=1TOPDfont%:PROCPDstring(F%,PDfname$(I%)):PROCPDstring(F%,PDfont$(I%)):PROCPD2byte(F%,PDcpl%(I%)):NEXT 50680BPUT#F%,PDchar% 50690IFPDchar%:FORI%=1TOPDchar%:BPUT#F%,PDfrom%(I%):PROCPDstring(F%,PDto$(I%)):BPUT#F%,PDclen%(I%):NEXT 50700PROCPDstring(F%,PDfix$):PROCPDstring(F%,PDff$):PROCPDstring(F%,CHR$PDsep%) 50710BPUT#F%,PDPrintAuto:ENDPROC 50720 50730DEFPROCPDload 50740LOCALF%,I%,A%,B%:F%=OPENINfile$:IFF%=0:ENDPROC 50750FORI%=1TO4:A%=BGET#F%:B%=(A%<<24)+(B%>>8):NEXT 50760IFB%<>&55010001:CLOSE#F%:PROCerr(48) 50770PDname$=FNPDstring(F%):PDreset$=FNPDstring(F%):PDfont%=BGET#F% 50780IFPDfont%:FORI%=1TOPDfont%:PDfname$(I%)=FNPDstring(F%):PDfont$(I%)=FNPDstring(F%):PDcpl%(I%)=FNPD2byte(F%):NEXT 50790PDchar%=BGET#F% 50800IFPDchar%:FORI%=1TOPDchar%:PDfrom%(I%)=BGET#F%:PDto$(I%)=FNPDstring(F%):PDclen%(I%)=BGET#F%:NEXT 50810PDfix$=FNPDstring(F%) 50820PDff$=FNPDstring(F%):PDsep%=ASCFNPDstring(F%):PDPrintAuto=BGET#F% 50830CLOSE#F%:PROCnewfn(f_pd$):IFw_pdrive%>0:PROCclosew(w_pdrive%) 50840PROCpdriver:ENDPROC 50850 50860DEFPROCPDstring(F%,A$):BPUT#F%,LENA$:IFLENA$BPUT#F%,A$; 50870ENDPROC 50880DEFPROCPD2byte(F%,W%)BPUT#F%,W%:BPUT#F%,W%>>8:ENDPROC 50890DEFFNPDstring(F%)LOCALA$,I% 50900L%=BGET#F%:IFL%:FORI%=1TOL%:A$+=CHR$BGET#F%:NEXT 50910=A$ 50920DEFFNPD2byte(F%)=BGET#F%+(BGET#F%<<8) 50930 50940DEFPROCPDtest:PROCgrabpr:PROCpprint(PDreset$) 50950PROCpprint(""):PROCpprint(""):LOCALT$:T$=STRING$(54,"-") 50960PROCpprint("Minerva Software - MultiStore User Printer Driver Test") 50970PROCpprint(T$):PROCPDtestfont(1):PROCPDtestfont(2):PROCPDtestfont(3) 50980PROCpprint1(PDfont$(1)):PROCpprint(T$):PROCppage(FALSE) 50990PROCreleasepr:ENDPROC 51000 51010DEFPROCPDtestfont(f%):PROCpprint1(PDfont$(f%)) 51020LOCALI%,T%,T$,w:w=0 51030PROCpprint1("Font"+STR$f%+": "):w+=PDcpl%(1)/PDcpl%(f%)*7 51040PROCPDtab(w,16):FORI%=1TO2 51050T%=20*PDcpl%(f%)/PDcpl%(1)-PDclen%(1)-PDclen%(2)-1 51060T$=LEFT$("ABCDEabcde01234",T%):PROCpprint1(T$+PDto$(1)+PDto$(2)) 51070w+=PDcpl%(1)/PDcpl%(f%)*(PDclen%(1)+PDclen%(2)+LENT$) 51080PROCPDtab(w,36):NEXT:PROCpprint(""):ENDPROC 51090 51100DEFPROCPDtab(RETURN w,T%) 51110T%=(T%-PDcpl%(1)/PDcpl%(f%)-w)*PDcpl%(f%)/PDcpl%(1)+.5:w+=T%*PDcpl%(1)/PDcpl%(f%):PROCpprint1(STRING$(T%," ")):ENDPROC 51120 51130DEFPROCpproc(RETURN A$):IFA$="":ENDPROC 51140LOCALI%,T%,T$,t% 51150FORI%=1TO10 51160T$=MID$("`$ABCDEFGH",I%,1):t%=1 51170IFpdriver%:T$=PDto$(I%):t%=PDclen%(I%) 51180IFPDclen%(I%)>0THEN 51190T%=0:REPEAT:T%=INSTR(A$,STRING$(t%,CHR$(I%+127)),T%) 51200IFT%:A$=LEFT$(A$,T%-1)+T$+MID$(A$,T%+t%):T%+=LENT$ 51210UNTILT%=0 51220ENDIF 51230NEXT:PROCppspc(A$):ENDPROC 51240 51250DEFPROCPDrdfont(I%) 51260PDfont$(I%)=FNPConv($FNia(w_pdrive%,I%+8)):IFLength<20:Length=80 51270PDcpl%(I%)=Length:ENDPROC 51280 51290DEFPROCppspc(RETURN A$) 51300LOCALT%,C%:REPEAT 51310C%=128:T%=0:WHILET%=0ANDC%<139:T%=INSTR(A$,CHR$C%):C%=C%-(T%=0):ENDWHILE 51320IFT%<>0:MID$(A$,T%,1)=" " 51330UNTILT%=0:ENDPROC 51340 51350DEFPROCppspc1(RETURN A$) 51360LOCALT%,C%,c%:REPEAT 51370C%=128:T%=0:WHILET%=0ANDC%<139:T%=INSTR(A$,CHR$C%):C%=C%-(T%=0):ENDWHILE 51380IFT%>0:c%=ASCMID$("�$ ",C%-127):IFc%<0:c%=32 51390IFT%<>0:MID$(A$,T%,1)=CHR$c% 51400UNTILT%=0:ENDPROC 51410 51420DEFPROCppexpand(RETURN A$) 51430LOCALI%,T%,t%,T$ 51440FORI%=1TO10:T%=0:REPEAT:T%=INSTR(A$,CHR$(PDfrom%(I%)),T%) 51450IFT%:A$=LEFT$(A$,T%-1)+STRING$(PDclen%(I%),CHR$(I%+127))+MID$(A$,T%+1):T%+=PDclen%(I%) 51460UNTILT%=0:NEXT:ENDPROC 51470 51480DEFPROCtestlab 51490LOCALI%:PROCgrabpr 51500LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCreleasepr:PROCerr(43) 51510SYSswi%,sd23_%TON% 51520e%(file%,2)=FNv_(15):e%(file%,0)=0:e%(file%,1)=1 51530FORI%=0TOmaxacr%-1:l1%(file%,I%)=1:NEXT:labline%=0 51540FORI%=1TOll%(file%,3)*2 51550PROClabline(1,FALSE) 51560NEXT:PROCreleasepr:ENDPROC 51570 51580DEFPROCprintone 51590LOCALI%:PROCgrabpr 51600LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCreleasepr:PROCerr(43) 51610SYSswi%,sd23_%TON% 51620e%(file%,2)=N%:e%(file%,0)=0:e%(file%,1)=1 51630FORI%=0TOmaxacr%-1:l1%(file%,I%)=1:NEXT:labline%=0 51640REPEAT 51650PROClabline(2,FALSE) 51660UNTILe%(file%,2)=-1 51670PROCreleasepr:ENDPROC 51680 51690DEFPROCgetpass:w_passw%=FNcrwind(tw_passw%) 51700PROCseti(w_passw%,0,"File "+FNfilename+", password:") 51710PROCseti(w_passw%,1,""):PROCseti(w_passw%,2,""):PROCseti(w_passw%,5,"") 51720PROCdialogue(w_passw%):ENDPROC 51730 51740DEFFNwordout0(X%,f%,T$) 51750REM ;{n Type 0 wordprocessor output. T$ is string to put (if any), 51760REM ;{n X% is file handle to put to. f% indicates function: 51770REM ;{n 0 Write file header (if any) 51780REM ;{n 1 Write record header (if any) 51790REM ;{n 2 Write first field of record 51800REM ;{n 3 Write other field of record (not first) 51810REM ;{n 4 Write record terminator 51820REM ;{n 5 Write file terminator (do NOT close file) 51830REM ;{n type 0 is ASCII as it is first in DATA statement - do 51840REM ;{n LISTIF(TSV) to see others - *s may be replaced by any 51850REM ;{n new types and functions corresponding to this, added. The 51860REM ;{n value returned by the function is a dummy so doesn't matter. 51870CASE f% OF 51880WHEN0:REM ASCII needs no file header 51890WHEN1:REM ASCII needs no record header 51900WHEN2:BPUT#X%,T$;:REM Put first field 51910WHEN3:BPUT#X%,CHR$9+T$;:REM other fields preceeded by TAB sep. 51920WHEN4:BPUT#X%,"":REM line terminator 51930WHEN5:REM ASCII needs no file terminator 51940ENDCASE 51950=0 51960 51970DEFFNwordout1(X%,f%,T$):REM ;{n View 51980CASE f% OF 51990WHEN1:BPUT#X%,CHR$128+"LE"; 52000WHEN2:BPUT#X%,""""+T$+""""; 52010WHEN3:BPUT#X%,","""+T$+""""; 52020WHEN4:BPUT#X%,"" 52030ENDCASE 52040=0 52050 52060DEFFNwordout2(X%,f%,T$):REM ;{n Interword 52070CASE f% OF 52080WHEN2,3:IFT$>""BPUT#X%,T$+CHR$13;:ELSEBPUT#X%," "+CHR$13; 52090WHEN4:BPUT#X%,13 52100ENDCASE 52110=0 52120 52130DEFFNwordout3(X%,f%,T$):REM ;{n 1stWord+ 52140=FNwordout5(X%,f%,T$):REM ;{n same as pipedream 52150 52160DEFFNwordout4(X%,f%,T$):REM ;{n CSV 52170CASE f% OF 52180WHEN2:BPUT#X%,""""+T$+""""; 52190WHEN3:BPUT#X%,","""+T$+""""; 52200WHEN4:BPUT#X%,"" 52210ENDCASE 52220=0 52230 52240DEFFNwordout5(X%,f%,T$):REM ;{n PipeDream 52250CASE f% OF 52260WHEN2:IFINSTR(T$,","):T$=""""+T$+"""" 52270BPUT#X%,T$; 52280WHEN3:IFINSTR(T$,","):T$=""""+T$+"""" 52290BPUT#X%,","+T$; 52300WHEN4:BPUT#X%,"" 52310ENDCASE 52320=0 52330 52340DEFFNwordout6(X%,f%,T$):REM ;{n WW+ 52350CASE f% OF 52360WHEN2,3:IFT$>""BPUT#X%,T$+CHR$13;:ELSEBPUT#X%," "+CHR$13; 52370ENDCASE 52380=0 52390 52400DEFFNwordout7(X%,f%,T$):REM ;{n DIF 52410CASE f% OF 52420WHEN0 52430BPUT#X%,"TABLE":BPUT#X%,"0,1":BPUT#X%,"""Mailshot""" 52440BPUT#X%,"VECTORS":BPUT#X%,"0,0000000000":BPUT#X%,"""""" 52450BPUT#X%,"TUPLES":BPUT#X%,"0,0000000000":BPUT#X%,"""""" 52460BPUT#X%,"DATA":BPUT#X%,"0,0":BPUT#X%,"""""" 52470WHEN1:BPUT#X%,"-1,0":BPUT#X%,"""BOT""" 52480WHEN2,3:BPUT#X%,"1,0":BPUT#X%,""""+T$+"""":vec%+=1 52490WHEN4:tuples%+=1:IFvectors%<=0vectors%=vec%:vec%=0:ELSEvec%=0 52500WHEN5 52510PTR#X%=&1F:BPUT#X%,RIGHT$("000000000"+STR$vectors%,10) 52520PTR#X%=&36:BPUT#X%,RIGHT$("000000000"+STR$tuples%,10) 52530ENDCASE 52540=0 52550 52560DEFPROCpdriver:w_pdrive%=FNcrwind(tw_pdrive%) 52570LOCALI%,L%,T$:PROCunselall(w_pdrive%) 52580RESTORE52640:FORI%=0TO6:READT$,L% 52590PROCseti(w_pdrive%,I%+7,FNMakePable(EVALT$,L%)):NEXT 52600PROCseli(w_pdrive%,pterm%+14) 52610IFpdriver%:PROCseli(w_pdrive%,17) 52620IFmanual%:PROCseli(w_pdrive%,23) 52630PROCdialogue(w_pdrive%):ENDPROC 52640DATAPDto$(1),PDclen%(1) 52650DATAPDto$(2),PDclen%(2) 52660DATAPDfont$(1),PDcpl%(1) 52670DATAPDfont$(2),PDcpl%(2) 52680DATAPDfont$(3),PDcpl%(3) 52690DATAPDff$,0 52700DATAPDreset$,0 52710 52720DEFPROCnewfn(RETURN T$):IFFNu(file$)<>"<WIMP$SCRAP>"T$=file$ 52730ENDPROC 52740 52750DEFPROCreadparams:LOCALI%,F%,T$ 52760maxf%=3:maxacr%=4:maxcol%=29:avchar%=65:ctchar%=67:manual%=FALSE 52770stopboxes%=TRUE:sound%=TRUE:shadows%=TRUE:tools%=TRUE:pix%=FALSE 52780lab_drop%=66:lab_lead%=0:cachefill%=FALSE:readonly%=FALSE 52790PDF$="":PDname$="Epson":PDreset$=FNPConv("27,'@',27,'R',0") 52800PDff$=CHR$12:PDsep%=9:RESTORE53000:READPDfont%:FORI%=1TOPDfont% 52810READPDfname$(I%),A$,PDcpl%(I%):PDfont$(I%)=FNPConv(A$):NEXT 52820READPDchar%:FORI%=1TOPDchar%:READPDfrom%(I%),A$,PDclen%(I%) 52830PDto$(I%)=FNPConv(A$):NEXT:PDfix$="":PDPrintAuto=FALSE:clearpass%=TRUE 52840sprsz%=0:dplen%=66:dpwid%=79:picpath$="<MultiStore$Dir>.^.Pictures." 52850f_pd$="PDriver":f_la$="LabelSet":f_wp$="WordSet":f_rp$="ReportSet" 52860f_np$="Notepad":f_mc$="Macro":f_rx$="Report":f_cd$="Card" 52870macs%=TRUE:macu%=TRUE:i_maxdead%=50 52880F%=OPENIN(FNdir+"Params") 52890IFF%:WHILENOTEOF#F%:PROCreadparam(GET$#F%):ENDWHILE:CLOSE#F% 52900IFsprsz%>50THEN 52910DIM sprbuf% sprsz%,colours% 366 52920!sprbuf%=sprsz%:sprbuf%!16=0:SYS"OS_SpriteOp",&109,sprbuf% 52930ELSE 52940sprsz%=0 52950ENDIF 52960T$=FNArfVar("MultiStorePics$Path"):picpath$=FNtrans(picpath$) 52970IFINSTR(T$,picpath$)>0picpath$=T$:ELSEIFT$>""picpath$=T$+","+picpath$ 52980OSCLI"*Set MultiStorePics$Path "+picpath$:pix%=sprsz%>0 52990ENDPROC 53000DATA3, Pica,"ESC,!,0",80,Elite,"ESC,!,1",96,Condensed,"ESC,!,4",136 53010DATA2 53020DATA96,"27,'R',3,35,27,'R',0",1 53030DATA36,"$",1 53040 53050DEFPROCreadparam(T$) 53060T$=FNs1(T$):IFT$=""ORASCT$=ASC";"ENDPROC 53070LOCALV$,T%,on,off:on=TRUE:T%=INSTR(T$," "):IFT%=0ENDPROC 53080V$=MID$(T$,T%):T$=LEFT$(T$,T%-1):V$=FNs1(V$) 53090T%=INSTR(V$,";"):IFT%V$=LEFT$(V$,T%-1) 53100LOCALERROR:ONERRORLOCAL:RESTOREERROR:ENDPROC 53110CASEFNlower(T$)OF 53120WHEN"shadow":shadows%=EVALV$ 53130WHEN"stopboxes":stopboxes%=EVALV$ 53140WHEN"sound":sound%=EVALV$ 53150WHEN"tools":tools%=EVALV$ 53160WHEN"pmoney1":PDto$(1)=FNPConv(V$):PDclen%(1)=Length 53170WHEN"pmoney2":PDto$(2)=FNPConv(V$):PDclen%(2)=Length 53180WHEN"pfont1":PDfont$(1)=FNPConv(V$):PDcpl%(1)=Length 53190WHEN"pfont2":PDfont$(2)=FNPConv(V$):PDcpl%(2)=Length 53200WHEN"pfont3":PDfont$(3)=FNPConv(V$):PDcpl%(3)=Length 53210WHEN"preset":PDreset$=FNPConv(V$) 53220WHEN"pformfeed":PDff$=FNPConv(V$) 53230WHEN"fnprinter":f_pd$=V$ 53240WHEN"fnlabel":f_la$=V$ 53250WHEN"fnwordpro":f_wp$=V$ 53260WHEN"fnrepset":f_rp$=V$ 53270WHEN"fnnotepad":f_np$=V$ 53280WHEN"fnmacro":f_mc$=V$ 53290WHEN"fnreport":f_rx$=V$ 53300WHEN"fncard":f_cd$=V$ 53310WHEN"clearpass":clearpass%=EVALV$ 53320WHEN"pagelen":dplen%=EVALV$ 53330WHEN"pagewid":dpwid%=EVALV$ 53340WHEN"pictures":sprsz%=EVALV$ 53350WHEN"labels":maxacr%=EVALV$ 53360WHEN"columns":maxcol%=EVALV$-1 53370WHEN"files":maxf%=EVALV$-1 53380WHEN"average":avchar%=ASCV$:IFavchar%<32ORavchar%=127avchar%=65 53390WHEN"count":ctchar%=ASCV$:IFctchar%<32ORctchar%=127ctchar%=67 53400WHEN"manual":manual%=EVALV$ 53410WHEN"picpath":picpath$=V$ 53420WHEN"macroupp":macu%=EVALV$ 53430WHEN"macrospc":macs%=EVALV$ 53440WHEN"lablead":lab_lead%=EVALV$ 53450WHEN"labdrop":lab_drop%=EVALV$ 53460WHEN"fillcache":fillcache%=EVALV$ 53470WHEN"readonly":readonly%=EVALV$ 53480WHEN"nullcount":i_maxdead%=EVALV$ 53490ENDCASE:ENDPROC 53500 53510DEFFNs1(T$):WHILEASCT$=32:T$=MID$(T$,2):ENDWHILE 53520WHILERIGHT$(T$)=" ":T$=LEFT$(T$):ENDWHILE:=T$ 53530 53540DEFPROCdefaultrep:IFr%(file%)<>5:PROCclearrep:ENDPROC 53550PROCstop(29,rl$+"create default","report layout",file%):ENDPROC 53560 53570DEFPROCclearrep 53580CASEr%(file%)OF 53590WHEN1:sr$(file%)="" 53600WHEN2:r$(file%)="" 53610WHEN3:PROCstop(30,rl$+"create default","label setup ?",file%):ENDPROC 53620WHEN4:PROCstop(31,rl$+"clear Wordprocessor","Output setup ?",file%):ENDPROC 53630WHEN5:PROCstop(33,rl$+"clear report","layout ?",file%):ENDPROC 53640ENDCASE:PROCmakerep(file%):ENDPROC 53650 53660DEFPROCswap7:PROCforce(w%(file%,0)):IFr%(file%)=0:PROCforcerep 53670SYSswi%,sd57_%,"bit7"TOG% 53680G%=G%EOR1:SYSswi%,sd58_%,G%,"bit7" 53690SYSswi%,sd57_%,"bit7"TOG% 53700PROCflg(f_7bit%,G%):SYSswi%,sd39_% 53710ENDPROC 53720 53730DEFFNpwcode(T$):IFT$="":="" 53740LOCALA%,B%,I%:FORI%=1TOLENT$ 53750MID$(T$,I%,1)=CHR$(ASCMID$(T$,I%)EOR(I%+173)) 53760NEXT:=T$ 53770 53780DEFPROCrmargin:LOCALT%,W%:W%=w_rset3% 53790T%=VAL$FNia(W%,7)-VAL$FNia(W%,12)-VAL$FNia(W%,16):IFT%<0T%=0 53800PROCseti(W%,19,STR$T%):ENDPROC 53810 53820DEFPROCdecodecol(T%) 53830column%=T%:cexp$=c$(file%,T%,0):IFcexp$="":ENDPROC 53840chdr$=c$(file%,T%,1) 53850T%=c%(file%,T%) 53860cwid%=T%AND255 53870cjus%=(T%>>8)AND3 53880cfnt%=(T%>>10)AND3 53890cupp%=(T%AND(1<<12))<>0 53900cspc%=(T%AND(1<<13))<>0 53910cdps%=(T%>>14)AND7:IFcdps%=7cdps%=-1 53920ctot%=((T%>>17)AND3)OR((T%>>23)AND4) 53930cbk0%=(T%AND(1<<19))<>0 53940ccma%=(T%AND(1<<20))<>0 53950cfrm%=(T%>>21)AND7 53960cdup%=(T%AND(1<<24))<>0 53970ENDPROC 53980 53990DEFPROCr_setcol(f%,I%) 54000LOCALT$,g%,h%:h%=file%:PROCsdfile(menufile%):SYSswi%,sd17_%,9,f%,sd$TOG% 54010T$=$sd%:SYSswi%,sd17_%,4,f%,sd$TOG% 54020g%=G%:IFh%<>file%T$+="\"+FNfilename 54030IFc$(h%,I%,0)="@"+T$ORc$(h%,I%,0)="#"+T$:ENDPROC 54040c$(h%,I%,1)=T$ 54050IF(g%AND7)=7THEN 54060c$(h%,I%,0)="@"+T$ 54070c%(h%,I%)=%1000000011110010000000000 54080ELSE 54090c$(h%,I%,0)="#"+T$ 54100c%(h%,I%)=%1000110000000011000000010OR((g%AND7)<<14) 54110ENDIF 54120SYSswi%,sd17_%,1,f%,sd$TOG% 54130c%(h%,I%)=(((c%(h%,I%)AND255)+G%)AND255)OR(c%(h%,I%)ANDNOT255) 54140PROCsdfile(h%):ENDPROC 54150 54160DEFPROCr_clear:LOCALI% 54170FORI%=0TOmaxcol%:PROCr_clearcol(I%):NEXT 54180FORI%=0TO7:p$(file%,I%)="":NEXT 54190ENDPROC 54200 54210DEFPROCr_clearcol(I%) 54220c$(file%,I%,0)="":c$(file%,I%,1)="" 54230c%(file%,I%)=%1000000011110010000000000 54240ENDPROC 54250 54260DEFFNdummyhdrs(B%) 54270$q%="":LOCALT% 54280I%=0:REPEAT:PROCdecodecol(I%):IFcexp$>""THEN 54290T%=cwid%:IFT%+LEN$q%<254THEN 54300T$=chdr$:CASEcjus%OF 54310WHEN0:T$=LEFT$(T$,T%):T$=T$+STRING$(T%-LENT$," ") 54320WHEN1:T$=LEFT$(T$,T%):T$=STRING$((T%-LENT$)/2," ")+T$:T$+=STRING$(T%-LENT$," ") 54330WHEN2:T$=LEFT$(T$,T%):T$=STRING$(T%-LENT$," ")+T$ 54340ENDCASE 54350IFLEN$q%>0:T$=" "+T$ 54360IFLEN$q%+LENT$<254:$q%+=T$ 54370ENDIF 54380ENDIF 54390I%+=1:UNTILI%>maxcol%ORLEN$q%>B%:=$q% 54400 54410DEFFNdummydsh(B%,T$,t%) 54420LOCALT%,I%,t$ 54430$q%="":I%=0:REPEAT:PROCdecodecol(I%):IFcexp$>""THEN 54440T%=cwid%:IF$q%>"":T%+=1 54450IFT%+LEN$q%<255THEN 54460IF$q%>"":$q%+=" ":T%-=1 54470t$=" ":IFt%OR(ctot%>0ANDcdps%>=0)t$=T$ 54480IFLEN$q%+T%<254:$q%+=STRING$(T%,t$) 54490ENDIF 54500ENDIF 54510I%+=1:UNTILI%>maxcol%ORLEN$q%>B%:=$q% 54520 54530DEFFNdummycols(L%,B%,t%):LOCALT%,T$,I% 54540$q%="":I%=0:REPEAT:PROCdecodecol(I%):IFcexp$>""THEN 54550T%=cwid%:IFT%+LEN$q%<254THEN 54560IFT%+LEN$q%+1<L%OR(NOTt%AND(ctot%=0ORcdps%<0))T$=STRING$(T%," "):ELSET$=FNdumform 54570IFLENT$+LEN$q%<254:$q%+=T$ 54580IFLEN$q%<254$q%+=" " 54590ENDIF 54600ENDIF 54610I%+=1:UNTILI%>maxcol%ORLEN$q%>B%:=$q% 54620 54630DEFFNdumform:LOCALT%,T$,F% 54640IFcdps%<0THEN 54650T$=MID$("xX",1-cupp%,1):T$=STRING$(cwid%,T$) 54660IFcwid%>2THEN 54670CASEcjus%OF 54680WHEN0:LEFT$(T$)="�" 54690WHEN1:MID$(T$,LENT$/2+1,1)="�" 54700WHEN2:RIGHT$(T$)="�" 54710ENDCASE 54720ENDIF 54730ELSE 54740T$=MID$("999-+*99",cfrm%+1,1):IFT$="9"ANDcbk0%T$="0" 54750T$=STRING$(cwid%,T$):T%=cdps%:F%=cfrm% 54760IFT%>0ANDT%<cwid%ANDF%<>5:MID$(T$,LENT$-T%,1)="." 54770IFccma%ANDT%>=0:T%=LENT$-T%-4-(T%=0):WHILET%>1-2*(F%=1)-(F%=2ORF%=7ORF%=8):MID$(T$,T%,1)=",":T%-=4:ENDWHILE 54780T%=F%:IFT%=1:IFLENT$>2:T$="("+MID$(T$,3)+")" 54790IFT%=2:IFLENT$>1:T$=MID$(T$,2)+"-" 54800IFT%=6:IFLENT$>1:T$="�"+MID$(T$,2) 54810IFT%=7:IFLENT$>1:T$="$"+MID$(T$,2) 54820ENDIF 54830=T$ 54840 54850DEFFNtopline:LOCALT$,A$ 54860A$=STRING$(p%(file%,2)," "):T$=LEFT$(p$(file%,0),LENA$) 54870MID$(A$,(LENA$-LENT$)/2+1)=T$ 54880IFFNflg(f_rtpn%):RIGHT$(A$)=" Page ###" 54890IFFNflg(f_rpdt%):LEFT$(A$)=date$+" " 54900=A$ 54910 54920DEFPROCedcol:w_col%=FNcrwind(tw_col%) 54930LOCALT%:menucol%=column%:T%=cdps%:IFT%<0T%=0 54940$FNta(w_col%)="Report Column "+RIGHT$("00"+STR$(column%+1),3) 54950PROCseti(w_col%,22,cexp$):PROCseti(w_col%,24,chdr$) 54960PROCseti(w_col%,10,STR$cwid%):PROCunselall(w_col%) 54970IFcjus%>1PROCseli(w_col%,2):ELSEPROCseli(w_col%,cjus%+31) 54980PROCseli(w_col%,cfnt%+5):PROCseli(w_col%,33+cfrm%) 54990IFcupp%PROCseli(w_col%,5) 55000IFcspc%PROCseli(w_col%,9) 55010IFcbk0%PROCseli(w_col%,3) 55020IFccma%PROCseli(w_col%,4) 55030IFcdup%PROCseli(w_col%,47) 55040IFcdps%<0PROCseli(w_col%,25):ELSEPROCseli(w_col%,27) 55050IFctot%AND1:PROCseli(w_col%,28) 55060IFctot%AND2:PROCseli(w_col%,29) 55070IFctot%AND4:PROCseli(w_col%,21) 55080PROCseti(w_col%,19,STR$T%):PROCdialogue(w_col%):ENDPROC 55090 55100DEFPROCaddcolumn:LOCALI%:cexp$="" 55110I%=maxcol%:WHILEI%>=0ANDcexp$="":PROCdecodecol(I%):I%-=1:ENDWHILE 55120IFI%>maxcol%-2PROCerr(53) 55130PROCdecodecol(I%+2):ENDPROC 55140 55150DEFPROCmousecol:LOCALX%,I% 55160X%=(mx%-bx%-margin%)DIV16+1:I%=0:REPEAT 55170PROCdecodecol(I%):IFcexp$=""cwid%=0 55180X%-=(cwid%-(cwid%>0)):IFX%>0I%+=1 55190UNTILX%<0ORI%>maxcol%:IFI%>maxcol%:column%=-1 55200ENDPROC 55210 55220DEFPROCinscol(I%):LOCALJ%:PROCaddcolumn:menufile%=file% 55230FORJ%=column%TOI%+1STEP-1:c$(file%,J%,0)=c$(file%,J%-1,0) 55240c$(file%,J%,1)=c$(file%,J%-1,1):c%(file%,J%)=c%(file%,J%-1):NEXT 55250PROCr_setcol(1,I%):PROCdecodecol(I%):PROCforcerep:ENDPROC 55260 55270DEFPROCdelcol(I%):LOCALJ% 55280FORJ%=I%TOmaxcol%-1:c$(file%,J%,0)=c$(file%,J%+1,0) 55290c$(file%,J%,1)=c$(file%,J%+1,1):c%(file%,J%)=c%(file%,J%+1):NEXT 55300PROCr_clearcol(maxcol%):PROCforcerep:ENDPROC 55310 55320DEFPROCpix:IFNOTpix%ENDPROC 55330IFNOTFNisfield("Pic"):ENDPROC 55340LOCALI%,T$:FORI%=0TO9:T$="Pic"+STR$(I%):IFFNisfield(T$)THEN 55350PROCfieldsz1(G%):tx0%+=bx%:tx1%+=bx%:ty0%+=by%:ty1%+=by% 55360SYSswi%,gfield_%,T$ 55370PROCplotspr($sd%) 55380ENDIF 55390NEXT:ENDPROC 55400 55410DEFPROCplotspr(T$) 55420IFNOTFNinbox(tx0%,ty0%,tx1%-tx0%,ty1%-ty0%)ENDPROC 55430LOCALT%,A%,B%,W%,H%,P%,s% 55440LOCALERROR:ONERRORLOCAL:IFINKEY-3:RESTOREERROR:PROCerr(54):ELSEENDPROC 55450*RMensure ColourTrans 0.51 RMload System:Modules.Colours 55460T$=FNloadspr(T$) 55470IFtx1%-tx0%>40ANDty1%-ty0%>40THEN 55480PROCgcol(0,8):RECTANGLEFILLtx0%,ty0%,tx1%-tx0%-1,ty1%-ty0%-1 55490PROCgcol(0,9):RECTANGLEtx0%+4,ty0%+4,tx1%-tx0%-9,ty1%-ty0%-9 55500RECTANGLEtx0%+6,ty0%+6,tx1%-tx0%-13,ty1%-ty0%-13 55510tx0%+=13:ty0%+=13:tx1%-=10:ty1%-=8 55520ENDIF 55530IFT$="":ENDPROC 55540SYS"OS_SpriteOp",&118,sprbuf%,T$TO,,s% 55550SYS"OS_ReadModeVariable",MODE,4 TO,,A% 55560SYS"OS_ReadModeVariable",MODE,5 TO,,B% 55570SYS"OS_SpriteOp",&128,sprbuf%,T$TO,,,W%,H%:W%=W%<<A%:H%=H%<<B% 55580IFs%!32=&2CTHEN 55590P%=0 55600ELSE 55610FORT%=0TO15:!(colours%+300+T%*4)=!(s%+44+T%*8)AND&FFFFFF00:NEXT 55620P%=colours%+300 55630ENDIF 55640colours%!260=tx1%-tx0%:colours%!264=ty1%-ty0% 55650colours%!268=W%:colours%!272=H% 55660SYS"ColourTrans_SelectTable",s%!40,P%,-1,-1,colours% 55670SYS"OS_SpriteOp",&134,sprbuf%,T$,tx0%,ty0%,8,colours%+260,colours% 55680ENDPROC 55690 55700DEFFNloadspr(T$):LOCALA$ 55710LOCALERROR 55720ONERRORLOCAL:="" 55730T$=FNsu(T$):T%=INSTR(T$,"{"):IFT%>0THEN 55740A%=INSTR(T$,"}",T%):IFA%=0A%=LENT$ 55750T$=LEFT$(T$,T%-1)+MID$(T$,A%+1) 55760ENDIF 55770IFT$="":="" 55780IFLEFT$(T$)="@"T$=MID$(T$,2) 55790T%=INSTR(T$,","):IFT%THEN 55800A$=FNsu(MID$(T$,T%+1)):T$=FNsu(LEFT$(T$,T%-1)) 55810IFINSTR(A$,":")=0A$="MultiStorePics:"+A$ 55820IFA$<>lastspr$SYS"OS_SpriteOp",&10A,sprbuf%,A$:lastspr$=A$ 55830ENDIF 55840SYS"OS_SpriteOp",&128,sprbuf%,T$:=T$ 55850 55860DEFFNpicfield(T%):SYSswi%,sd17_%,9,T%,sd$TOG% 55870SYSswi%,upper_% 55880=LEFT$($sd%,3)="PIC"ANDsd%?3>47ANDsd%?3<58 55890 55900DEFFNreadonly:SYSswi%,sd13_%,&E6TOG% 55910=(G%AND32)<>0 55920 55930DEFFNnindices:SYSswi%,sd57_%,"indices"TOG% 55940=G% 55950 55960DEFFNisfield(T$):SYSswi%,sd67_%,T$,sd$TOG% 55970=G%>0 55980 55990DEFPROCfielddrc:LOCALT%,X%,Y%,f%,T$ 56000f%=file%:T%=FNmousef:IFf%<>menufile%ANDT%=0:ENDPROC 56010IFf%<>menufile%THEN 56020PROCsdfile(menufile%):T$=FNgfield(menufield%) 56030PROCsdfile(f%):IFNOTFNdeadfile(-1)PROCpfield(T%,T$) 56040ENDPROC 56050ENDIF 56060IFT%<>0ANDT%<>menufield%T$=FNgfield(menufield%):PROCpfield(T%,T$):ENDPROC 56070X%=mx%-tx0%+8:Y%=my%-ty0%:PROCfieldsz(menufield%):Y%+=ty1%-ty0%-16 56080PROCcxconv(X%):PROCcyconv(Y%):tx0%=X%:ty0%=Y% 56090IFT%<>0THEN 56100SYSswi%,sd17_%,2,menufield%,sd$TOG% 56110T%=G%:SYSswi%,sd17_%,3,menufield%,sd$TOG% 56120IFG%=ty0%ANDT%=tx0%:ENDPROC 56130ENDIF 56140PROCstop(32,"Field "+FNfname(menufield%),rl$+"move field ?",file%) 56150ENDPROC 56160 56170DEFPROCupplit(RETURN A$):LOCALQ%,I%,C%:IFA$="":ENDPROC 56180FORI%=1TOLENA$:C%=ASCMID$(A$,I%):IFC%=34Q%=NOTQ% 56190IFQ%ANDC%>96ANDC%<123MID$(A$,I%,1)=CHR$(C%-32) 56200NEXT:ENDPROC 56210 56220DEFPROCnewnotes 56230PROCzfound:PROCnewfilt:PROCnewlink:PROCnewrep 56240PROCvalidrec:PROCvalidlink:PROCforcerep:ENDPROC 56250 56260DEFPROCnewfilt:IFl%(file%)>0ENDPROC 56270LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCnofilt:ENDPROC 56280LOCALT$:T$=FNx1(f$(file%)):fx$(file%)=T$:PROCshowfilter:ENDPROC 56290 56300DEFPROCnewlink:IFl%(file%)<=0ENDPROC 56310LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCunlink:ENDPROC 56320lx$(file%)=FNx4(l$(file%):ENDPROC 56330 56340DEFPROCnewrep:IFw%(file%,3)<=0:ENDPROC 56350LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCclosew(w%(file%,3)):ENDPROC 56360PROCmakerep(file%):ENDPROC 56370 56380DEFPROCtonedial(A$):IFA$="":ENDPROC 56390VOICES2:VOICE1,"WaveSynth-Beep":VOICE2,"WaveSynth-Beep" 56400LOCALI%:FORI%=1TOLENA$:PROCtone(INSTR("0123456789*#",MID$(A$,I%,1))) 56410PROCdelay(6):NEXT:ENDPROC 56420 56430DEFPROCtone(I%):I%-=1:IFI%<0ORI%>11ENDPROC 56440SOUND 1,-15,tone%(I%,0),100:SOUND 2,-15,tone%(I%,1),100 56450PROCdelay(10):SOUND 1,0,0,0:SOUND 2,0,0,0:ENDPROC 56460 56470DEFPROCdelay(I%):LOCALT%:T%=TIME:REPEATUNTILTIME>T%+I%:ENDPROC 56480FORI%=0TO9:FORJ%=0TO1:PRINT~tone%(I%,J%);:NEXT:PRINT:NEXT 56490 56500DEFFNcolv(T$) 56510LOCALs%,t,t%,T% 56520LOCALERROR:ONERRORLOCAL:RESTOREERROR:@%=&90A:PROCerr(52) 56530IFcdps%<0THEN 56540colval=0:IFFNflg(f_rtsu%):="" 56550$sd%=FNev2(T$,cspc%,cupp%) 56560IFcspc%:SYSswi%,strip_% 56570IFcupp%:SYSswi%,upper_% 56580ELSE 56590t=FNev(T$,cspc%,cupp%):s%=SGNt:t=ABSt 56600IFcbk0%ANDs%=0THEN 56610$sd%="":colval=0 56620ELSE 56630@%=&1020019+(cdps%<<8):$sd%=STR$t:colval=VAL$sd%*s%:@%=&90A 56640IFFNflg(f_rtsu%):=$sd% 56650IFRIGHT$($sd%)="."$sd%=" "+LEFT$($sd%) 56660CASEcfrm%OF 56670WHEN0:IFs%<0$sd%="-"+$sd% 56680WHEN1:IFs%<0$sd%="("+$sd%+")":ELSEIFcjus%<>1$sd%+=" " 56690WHEN2:IFs%<0$sd%+="-":ELSEIFcjus%<>1$sd%+=" " 56700WHEN3:IFs%<0$sd%="" 56710WHEN4:IFs%>0$sd%="" 56720WHEN5:T%=VAL$sd%*-(s%>0)/10^cdps%:IFT%>254T%=254 56730$sd%=STRING$(T%,"*"):IFLEN$sd%>cwid%$sd%=LEFT$($sd%,cwid%-1)+"+" 56740WHEN6:$sd%="`"+$sd%:IFs%<0$sd%="-"+$sd% 56750WHEN7:$sd%="$"+$sd%:IFs%<0$sd%="-"+$sd% 56760ENDCASE 56770IFccma%THEN 56780t%=0:WHILE(sd%?t%<48ORsd%?t%>57)ANDsd%?t%<>13:t%+=1:ENDWHILE 56790T%=INSTR($sd%,"."):IFT%=0T%=LEN$sd%+1 56800T%-=3:WHILET%>t%+1ANDLEN$sd%<cwid% 56810$sd%=LEFT$($sd%,T%-1)+","+MID$($sd%,T%):T%-=3 56820ENDWHILE 56830ENDIF 56840ENDIF 56850ENDIF 56860$sd%=FNstrjus($sd%,cwid%,cjus%):=$sd% 56870 56880DEFPROCcheckrep 56890LOCALI%:FORI%=0TOmaxf%:IFa%(I%)=10:IFr%(I%)=5:PROCerr(55) 56900NEXT:ENDPROC 56910 56920DEFPROCcols:PROCsdfile(rmf%) 56930LOCALI%,J%,T$,w 56940I%=0:w=rpwid%:IFoutrep%=2:w=131 56950REPEAT 56960IFc$(file%,I%,0)>""THEN 56970PROCdecodecol(I%):T$=FNx7(cexp$) 56980IFprl%<>2:cv$(I%,0)=FNrblnk:ELSEcv$(I%,0)=LEFT$(cv$(I%,0)) 56990IFFNrbm(FNu(T$))THEN 57000cv$(I%,0)=FNcolv(T$) 57010IFNOTcdup%ANDcv$(I%,0)=cv$(I%,1)THEN 57020cv$(I%,0)=FNrblnk 57030ELSE 57040cv$(I%,1)=cv$(I%,0):FORJ%=0TO3:ct(I%,J%)+=colval 57050IFcv$(I%,0)<>STRING$(cwid%," ")ct%(I%,J%)+=1 57060NEXT 57070ENDIF 57080ENDIF 57090REPEAT:T%=FNprlen(cv$(I%,0)):IFT%>w:cv$(I%,0)=LEFT$(cv$(I%,0)) 57100UNTILT%<=w 57110IFw>=T%+1:cv$(I%,0)+=" " 57120w-=FNprlen(cv$(I%,0)) 57130ELSE 57140cv$(I%,0)="" 57150ENDIF 57160I%+=1:UNTILI%>maxcol%ORw<1 57170ENDPROC 57180 57190DEFFNrbm(T$) 57200LOCALI%,t$:FORI%=0TOmaxf%:IFrbm%AND(1<<I%)THEN 57210IFI%=rmf%THEN 57220IFINSTR(T$,"\")=0:=TRUE 57230ELSE 57240t$="\"+FNu(FNofilename(I%)):IFINSTR(T$,t$):=TRUE 57250ENDIF 57260ENDIF 57270NEXT:=FALSE 57280 57290DEFFNprlen(T$):LOCALT%:T%=LENT$ 57300DEFFNprlen1(T%) 57310IFNOTpdriver%:=T%:ELSE=T%*PDcpl%(1)/PDcpl%(cfnt%) 57320 57330DEFFNrblnk=STRING$(cwid%," ") 57340 57350DEFPROCpreview:outrep%=2:PROCinitrep 57360LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCpreverr:ENDPROC 57370SYS"Wimp_CommandWindow",1:PROCnormpoint:mode%=MODE:*fx229,1 57380rphei%=30:rpwid%=p%(file%,2) 57390MODE16:VDU19,9,16,0,0,&30,19,10,16,&A0,&A0,0:OFF:PROCprlinest 57400REPEAT:IFINKEY0=27:PROCerr(56) 57410UNTILNOTFNprline 57420*fx229,1 57430PROCsd03("Press a key... ") 57440PRINTTAB(19,31);:PROCwaitkey:PROCendoscli:PROCendact:ENDPROC 57450 57460DEFFNprline:LOCALT%,n% 57470rbm%=-1:CASEprl%OF 57480WHEN0:PROCsdfile(rmf%):PROCsdnext:PROCsdfile(rmf%):T%=NOTFNbadrec(FNv_(15)) 57490WHEN1:rbm%=0:T%=FNprl1 57500WHEN2:PROCsdfile(rmf%):n%=FNv_(15):rbm%=0:T%=FNprl1 57510ENDCASE 57520PROCsdfile(rmf%):IFNOTT%:PROCprfinish:=FALSE 57530T%=1-FNflg(f_rdsp%):IFprl%=2ANDtlines%<>0T%=T%*tlines% 57540PROCendpage(T%):PROCprsubs(TRUE) 57550IFprl%<>2THEN 57560PROCcols:IFNOTFNflg(f_rtsu%):PROCprdsp:PROCpropcols 57570ELSE 57580PROCcols 57590IFNOTFNflg(f_rtsu%)ANDrpr1%PROCprdsp:PROCprtot(3):ELSErpr%=FALSE 57600ENDIF 57610=TRUE 57620 57630DEFFNprl1:LOCALT%:PROCsdfile(rlf%) 57640CASErpc%OF 57650WHEN0 57660T%=FNnxlnk:IFT%>=0THEN 57670IFFNgetlink(T%,0)THEN 57680rbm%=rbm%OR((1<<rlf%)ANDNOTrpr%):rsp%+=1:rs%(rsp%)=rlf% 57690rlf%=file%:rll%=-1:rpr%=FALSE 57700ELSE 57710PROCsdfile(rlf%):rll%=T% 57720ENDIF 57730=FNprl1 57740ENDIF 57750rbm%=rbm%OR(1<<rlf%):rpc%=1-rpr%:rpr1%=rpc%=1 57760IFprl%=2ANDrpr1%ANDrmf%<>rlf%THEN 57770PROCsdfile(rlf%):T%=FNv_(14) 57780IFFNgetlink(rlf%,FNv_(14)):rpr1%=FALSE 57790PROCsdfile(rlf%):SYSswi%,locate_%,T%TOD% 57800ENDIF 57810=FNprl1 57820WHEN1:rbm%=rbm%OR(1<<rlf%):rpc%=2:rpr%=TRUE:=TRUE 57830WHEN2 57840rpr1%=FALSE:IFrlf%=rmf%THEN 57850IFNOTrpr%:rpc%=1:rpr1%=TRUE:=FNprl1 57860PROCsdnext:rll%=-1:rpc%=0:rpr%=FALSE:IFFNbadrec(FNv_(15)):=FALSE:ELSE=FNprl1 57870ELSE 57880IFFNgetlink(rlf%,FNv_(14))rpc%=0:rpr%=FALSE:rll%=-1:=FNprl1 57890rbm%=rbm%ANDNOT(1<<rlf%):rll%=rlf%:rpr%=TRUE 57900PROCsdfile(rs%(rsp%)):rsp%-=1:rlf%=file%:rpc%=0:=FNprl1 57910ENDIF 57920ENDCASE:=FALSE 57930 57940DEFFNgetlink(rlf%,T%):LOCALT$ 57950LOCALERROR 57960ONERRORLOCAL:RESTOREERROR:PROCsdfile(rlf%):PROCunlink:PROCerr(37) 57970PROCsdfile(l%(rlf%)-1):T$=FNev(lx$(rlf%),TRUE,TRUE):PROCsdfile(rlf%) 57980G%=0:IFT$>"":PROCdup1(lk$(file%)+"="+T$,T%) 57990T%=G%:IFG%=0:SYSswi%,first_%TO,N% 58000PROCsd35:=T%<>0 58010 58020DEFFNnxlnk:LOCALT%:T%=rll% 58030REPEAT:T%+=1:IFT%<=maxf%:IFl%(T%)-1=file%:IFrl%(T%):=T% 58040UNTILT%>maxf%:=-1 58050 58060DEFPROCpreverr:*fx229,1 58070PROCbuzz2:$sd%=REPORT$ 58080IFNOTFNprod:$sd%=$sd%+" ("+STR$ERL+")" 58090$sd%=$sd%+" [Press any key] ":PROCsd03($sd%) 58100PRINTTAB(LEN$sd%+4,31);:PROCwaitkey:PROCendoscli:PROCendact:ENDPROC 58110 58120DEFFNprwidth:LOCALw,I% 58130FORI%=0TOmaxcol%:PROCdecodecol(I%):IFcexp$>"":w+=FNprlen1(cwid%+1) 58140NEXT:=INTw+(INTw>0) 58150 58160DEFPROCprdsp:IFNOTFNflg(f_rdsp%):ENDPROC 58170IFpline%<rphei%-2OR(p%(file%,4)=0ANDoutrep%<>2):PROCprnewline 58180ENDPROC 58190 58200DEFPROCpropcols:LOCALT$,I% 58210FORI%=0TOmaxcol%:PROCdecodecol(I%):T$=cv$(I%,0) 58220IFcexp$>""PROCprsetfont(cfnt%):PROCppexpand(T$):PROCprpstr(T$) 58230NEXT:PROCprnewline:ENDPROC 58240 58250DEFPROCprnewline:LOCALT%:T%=80:IFpdriver%:T%=PDcpl%(1) 58260CASEoutrep%OF 58270WHEN0:PROCpnewl 58280WHEN1:PROCdnewl 58290WHEN2:PRINT 58300ENDCASE 58310pline%+=1:PROCprlinest 58320ENDPROC 58330 58340DEFPROCprlinest 58350LOCALT%:T%=80:IFpdriver%:IFprfnt%>=0:T%=PDcpl%(1) 58360IFoutrep%=2:PROCtext_newl(rpwid%,T%) 58370PROCprsetfont(1):IFoutrep%<>2PROCprpstr(STRING$(p%(file%,1)," ")) 58380ENDPROC 58390 58400DEFPROCprsetfont(T%):IFNOTpdriver%:T%=1 58410IFprfnt%<>T%ANDoutrep%<>2ANDpdriver%:PROCprpstr(PDfont$(T%)) 58420prfnt%=T%:ENDPROC 58430 58440DEFPROCprpstr(T$) 58450LOCALT%:T%=80:IFpdriver%:IFprfnt%>=0:T%=PDcpl%(prfnt%) 58460CASEoutrep%OF 58470WHEN0:PROCpproc(T$):PROCpprint1(T$) 58480WHEN1:PROCdprint1(T$) 58490WHEN2:PROCppspc1(T$):PROCtext_pstr(T$,T%) 58500ENDCASE 58510ENDPROC 58520 58530DEFPROCprpline(T$):PROCprpstr(T$):PROCprnewline:ENDPROC 58540 58550DEFPROCendpage(T%):T%+=2 58560IFp%(file%,4)=0:IFoutrep%<>2:PROCprpagehead:ENDPROC 58570IFpline%>rphei%-T%+1:IFpdriver%:PROCprfooter:PROCpreject(TRUE) 58580PROCprpagehead:ENDPROC 58590 58600DEFPROCprfooter 58610LOCALW%,T%:W%=prw%:IFW%>rpwid%W%=rpwid% 58620PROCprdash(TRUE,"-") 58630IFp%(file%,3)>0:WHILEpline%<rphei%:PROCprnewline:ENDWHILE 58640$sd%="":IFFNflg(f_rbpn%):$sd%=LEFT$("Page "+STR$ppage%,W%):$sd%=STRING$((W%-LEN$sd%)/2," ")+$sd% 58650PROCprpstr($sd%) 58660T%=80:IFpdriver%:T%=PDcpl%(1) 58670CASEoutrep%OF 58680WHEN0:PROCpnewl 58690WHEN1:PROCdnewl 58700WHEN2:PRINT 58710ENDCASE 58720pline%+=1:ENDPROC 58730 58740DEFPROCpreject(T%) 58750IFoutrep%<>2IFp%(file%,4)=0ORNOTpdriver%:PROCprnewline:pline%=1:ENDPROC 58760IFoutrep%<>2ANDPDff$>""ANDpdriver%THEN 58770pline%=0 58780IFoutrep%=1ANDpdriver%PROCprpstr(PDff$):ENDPROC 58790IFoutrep%=0ANDpdriver%PROCppage(T%):ELSEIFNOTpdriver%:PROCprnewline 58800ENDPROC 58810ENDIF 58820IFoutrep%<>2WHILEpline%<p%(file%,4):PROCprnewline:ENDWHILE:pline%=0:ENDPROC 58830PROCsd03("Press a key... ") 58840PRINTTAB(19,31);:PROCwaitkey:IFG%=27:PROCerr(56) 58850CLS:pline%=0:OFF:PROCprlinest:ENDPROC 58860 58870DEFPROCprpagehead:IFpline%<>0:ENDPROC 58880LOCALT$,T%,C%,I%,w 58890fline%=-9999:ppage%+=1:PROCprsetfont(1):PROCprlinest 58900REPEAT:$sd%=FNprheader(pline%):PROCprpline($sd%):UNTIL$sd%="" 58910FORC%=0TOmaxcol%:cv$(C%,0)="":NEXT 58920w=rpwid%:IFoutrep%=2:w=131 58930C%=0:REPEAT 58940PROCdecodecol(C%):IFcexp$>""THEN 58950T$=FNstrjus(chdr$,cwid%,cjus%) 58960REPEAT:T%=FNprlen(T$):IFT%>w:T$=LEFT$(T$) 58970UNTILT%<=w:IFw>=T%+1:T$+=" " 58980w-=FNprlen(T$):cv$(C%,0)=T$ 58990ENDIF 59000C%+=1:UNTILC%>maxcol%ORw<1 59010PROCpropcols:PROCprdash(TRUE,"-"):ENDPROC 59020 59030DEFPROCprdash(f%,t$):IFpline%=fline%:ENDPROC 59040LOCALT%,C%,c%,w:w=rpwid%:IFoutrep%=2:w=131 59050FORC%=0TOmaxcol%:cv$(C%,0)="":NEXT 59060C%=0:REPEAT 59070PROCdecodecol(C%):IFcexp$>""THEN 59080IFf%OR(ctot%<>0ANDcdps%<>-1):c%=ASCt$:ELSEc%=32 59090T$=STRING$(cwid%,CHR$c%) 59100REPEAT:T%=FNprlen(T$):IFT%>w:T$=LEFT$(T$) 59110UNTILT%<=w:IFw>=T%+1:T$+=" " 59120w-=FNprlen(T$):cv$(C%,0)=T$ 59130ENDIF 59140C%+=1:UNTILC%>maxcol%ORw<1 59150PROCpropcols:fline%=pline%:ENDPROC 59160 59170DEFFNprheader(L%) 59180LOCALW%:W%=prw%:IFW%>rpwid%W%=rpwid% 59190IFW%<1ORL%>3:="" 59200LOCALT$,T%,s$ 59210s$=LEFT$(p$(file%,L%),W%):PROCppexpand(s$) 59220s$=STRING$((W%-LENs$)/2," ")+s$:s$+=STRING$(W%-LENs$," ") 59230IFL%=0THEN 59240IFFNflg(f_rpdt%):T$=date$:s$=T$+" "+MID$(s$,LENT$+2) 59250IFFNflg(f_rtpn%):IFLENs$<10:s$=" "+s$ 59260IFFNflg(f_rtpn%):T$=" Page "+STR$ppage%:RIGHT$(s$)=T$ 59270ENDIF 59280$sd%=s$:PROCstrip1:IF$sd%=""ANDL%<3THEN 59290FORL%=L%+1TO3:IFp$(file%,L%)>"":=" " 59300NEXT 59310ENDIF:=LEFT$($sd%,W%) 59320 59330DEFFNstrjus(T$,W%,J%) 59340IFJ%=2T$=RIGHT$(T$,W%)ELSET$=LEFT$(T$,W%) 59350IFJ%=1T$=STRING$((W%-LENT$)/2," ")+T$ 59360IFJ%<2T$+=STRING$(W%-LENT$," ") 59370=STRING$(W%-LENT$," ")+T$ 59380 59390DEFPROCprfinish 59400PROCprsubs(FALSE):PROCprgtot 59410PROCprfooter:IFFNflg(f_reja%):IFoutrep%<>2:PROCpreject(FALSE) 59420PROCsdfile(rmf%):ENDPROC 59430 59440DEFPROCprsubs(e%):LOCALI% 59450IFe%:subval$=FNprsubval(p$(file%,4)):ssubval$=FNprssubval(p$(file%,6)):ELSEssubval$="":subval$="" 59460IFlsubval$=" "ANDlssubval$=" "lssubval$=ssubval$:lsubval$=subval$:ENDPROC 59470IFssubval$=lssubval$ANDlsubval$=subval$ENDPROC 59480PROCendpage(3+tlines%+(pline%=fline%)) 59490IFtotals%<>0:PROCprdash(FALSE,"-") 59500IF(ssubval$<>lssubval$OR(ssubval$>""ANDsubval$<>lsubval$))THEN 59510IFp$(file%,7)>""ORFNflg(f_rtsu%):PROCprpline(LEFT$(p$(file%,7)+" ("+lssubval$+")",rpwid%)) 59520PROCprtot(2):PROCprdash(totals%=0,"-") 59530ENDIF 59540IFsubval$<>lsubval$THEN 59550PROCendpage(4+(pline%=fline%)+(p$(file%,5)="")+(totals%=0)) 59560IFp$(file%,5)>""ORFNflg(f_rtsu%):PROCprpline(LEFT$(p$(file%,5)+" ("+lsubval$+")",rpwid%)) 59570PROCprtot(1):PROCprdash(totals%=0,"=") 59580IFe%:IFFNflg(f_rtpg%)PROCprfooter:PROCpreject(TRUE):PROCprpagehead 59590ENDIF 59600lsubval$=subval$:lssubval$=ssubval$ 59610ENDPROC 59620 59630DEFPROCprgtot:IFtotals%=0ANDI%<>3:ENDPROC 59640PROCendpage(3+tlines%+(pline%=fline%)) 59650PROCprdash(TRUE,"="):PROCprpline(LEFT$("** GRAND TOTALS **",rpwid%)) 59660PROCprtot(0):PROCprdash(TRUE,"="):ENDPROC 59670 59680DEFPROCprtot(I%) 59690IFtotals%=0ANDI%<>3:ENDPROC 59700LOCALA%,T%,C%,w,f%,J%,K%:f%=FNflg(f_rtsu%):PROCflg0(f_rtsu%) 59710FORJ%=0TO2 59720IFI%<3ORA%FORC%=0TOmaxcol%:cv$(C%,0)="":NEXT:C%=0 59730IF(ttot%AND(2^J%))OR(I%=3ANDJ%=2ANDNOTA%)THEN 59740w=rpwid%:IFoutrep%=2:w=131 59750REPEAT 59760PROCdecodecol(C%):IFcexp$>""AND(I%<3ORINSTR(cexp$,"\"))THEN 59770K%=(2^J%)ANDctot%AND(cdps%<>-1) 59780CASEK%OF 59790WHEN0:IFI%<3ORA%$sd%=FNrblnk:ELSE$sd%=LEFT$(cv$(C%,0)) 59800WHEN1:$sd%=FNcolv(STR$ct(C%,I%)) 59810WHEN2:IFct%(C%,I%)>0:$sd%=FNcolv(STR$(ct(C%,I%)/ct%(C%,I%))):ELSE$sd%=FNrblnk 59820WHEN4:$sd%=FNcolv(STR$ct%(C%,I%)) 59830ENDCASE 59840IFI%=3:IFctot%<>0ANDcdps%<>-1:IFK%=0:$sd%=FNrblnk 59850REPEAT:T%=FNprlen($sd%):IFT%>w:$sd%=LEFT$($sd%) 59860UNTILT%<=w:IFw>=T%+1THEN 59870CASE TRUE OF 59880WHEN K%=2AND$sd%<>STRING$(LEN$sd%," "):$sd%+=CHR$avchar% 59890WHEN K%=4AND$sd%<>STRING$(LEN$sd%," "):$sd%+=CHR$ctchar% 59900OTHERWISE$sd%+=" " 59910ENDCASE 59920ENDIF 59930cv$(C%,0)=$sd%:w-=FNprlen($sd%) 59940ENDIF 59950C%+=1 59960UNTILC%>maxcol%ORw<1 59970PROCpropcols:A%=TRUE 59980ENDIF 59990NEXT 60000FORC%=0TOmaxcol%:ct%(C%,I%)=0:ct(C%,I%)=0:NEXT 60010PROCflg(f_rtsu%,f%):ENDPROC 60020 60030DEFFNprsubval(T$):IFT$="":="" 60040LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(57) 60050=FNev2(T$,TRUE,TRUE) 60060 60070DEFFNprssubval(T$):IFT$="":="" 60080LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(58) 60090=FNev2(T$,TRUE,TRUE) 60100 60110DEFPROCcreate:LOCALT%,B%,T$ 60120IFFNv_(1)>0THEN 60130PROCstop(39,"Entering Create mode will","close all open files",-1) 60140ENDPROC 60150ENDIF 60160LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(60) 60170T$=FNdir+"MSCreate":T%=OPENIN(T$):IFT%=0PROCerr(59) 60180B%=BGET#T%:CLOSE#T%:PROCwriteflags:RESTOREERROR 60190ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 60200PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 60210PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 60220PROCnormpoint:*Set MultiStore$Function 1 60230PROCnovars:PROCi_close:Z%=taskhandle%:CHAIN(T$):END 60240 60250DEFPROCtransfer:LOCALT%,B%,T$,A$ 60260LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(62) 60270T$=FNdir+"MSTransfer":T%=OPENIN(T$):IFT%=0PROCerr(59) 60280B%=BGET#T%:CLOSE#T%:RESTOREERROR 60290A$="":T%=0:REPEAT 60300IFw%(T%,0)>0THEN 60310IFA$=""A$=fn$(T%)ELSEA$+=","+fn$(T%):T%=maxf% 60320ENDIF 60330T%+=1:UNTILT%>maxf%:PROCCLOSE:PROCwriteflags 60340ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 60350PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 60360PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 60370PROCnormpoint:OSCLI"*Set MultiStore$Function 1:"+A$ 60380PROCnovars:PROCi_close:Z%=taskhandle%:CHAIN(T$):END 60390 60400DEFPROCfastsort:LOCALT%,B%,T$,A$ 60410LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCerr(62) 60420T$=FNdir+"MSFastSort":T%=OPENIN(T$):IFT%=0PROCerr(59) 60430B%=BGET#T%:CLOSE#T%:RESTOREERROR 60440A$="":T%=0:REPEAT 60450IFw%(T%,0)>0THEN 60460IFA$=""A$=fn$(T%):T%=maxf% 60470ENDIF 60480T%+=1:UNTILT%>maxf%:PROCCLOSE:PROCwriteflags 60490ONERRORPROCerror(ERR,REPORT$,ERL,TRUE):PROCreport:PROCquit(FALSE) 60500PROCdelw(w_stop%):PROCdelw(w_save%):PROCdelw(w_pinfo%) 60510PROCdelw(w_pinfo2%):PROCdelw(w_shadow%) 60520PROCnormpoint:OSCLI"*Set MultiStore$Function 1:"+A$ 60530PROCnovars:PROCi_close:Z%=taskhandle%:CHAIN(T$):END 60540 60550DEFPROCcheckconv(T$):LOCALT%,B% 60560LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#T%:ENDPROC 60570file$=T$:T%=OPENIN(file$):IFT%=0:ENDPROC 60580B%=BGET#T%:IFB%<>234ANDB%<>235:CLOSE#T%:ENDPROC 60590B%=BGET#T%+BGET#T%+BGET#T%+BGET#T%:CLOSE#T% 60600RESTOREERROR 60610IFB%=0B%=ft_form%ELSEB%=ft_data% 60620menufield%=B%:PROCstop(36,"Wrong file type","Convert to MultiStore ?",-1) 60630ENDPROC 60640 60650DEFPROCselindex(I%,f%):LOCALT$,T%:T$="A":IFf%:T$="D" 60660SYSswi%,istat_%,-1TOG%,T% 60670IF(T%=I%AND(G%AND32)=((f%<>0)AND32))OR(T%<=0ANDI%<=0):ENDPROC 60680IFI%>0THEN 60690SYSswi%,order_%,I%,T$TON% 60700ELSE 60710SYSswi%,order_%TON% 60720ENDIF 60730PROCshowindex:PROCvalidrec:PROCchkmv:PROCgraph:ENDPROC 60740 60750DEFPROCclrmv:SYSswi%,sd58_%,0,"moved" 60760ENDPROC 60770 60780DEFPROCchkmv:LOCALN%:SYSswi%,sd57_%,"moved"TOG% 60790IFG%=0:ENDPROC 60800IFw%(file%,3)>0IFr%(file%)<3PROCforcerep 60810PROCclrmv:ENDPROC 60820 60830DEFPROCchkmv1(T%,U%):IFT%=U%:ENDPROC 60840LOCALN%:SYSswi%,sd57_%,"moved"TOG% 60850IFG%=0:ENDPROC 60860IFw%(file%,3)>0IFr%(file%)<3PROCforcecardsrep(T%,U%) 60870PROCclrmv:PROCshownum:ENDPROC 60880 60890DEFFNfirstspr(A$):LOCALX%,I%,T%,T$ 60900LOCALERROR:ONERRORLOCAL:="?" 60910X%=OPENIN(A$):IFX%=0:="?" 60920ONERRORLOCAL:RESTOREERROR:CLOSE#X%:="?" 60930T%=0:FORI%=0TO3:T%=T%OR(BGET#X%<<(I%*8)):NEXT:IFT%<1:="?" 60940T%=0:FORI%=0TO3:T%=T%OR(BGET#X%<<(I%*8)):NEXT:IFT%<1:="?" 60950PTR#X%=T%:I%=0:T$="":REPEAT:T%=BGET#X%:I%+=1:IFT%>31T$+=CHR$T%:ELSEI%=99 60960UNTILI%>11:CLOSE#X%:=T$ 60970 60980DEFPROCloadspr(A$):LOCALT%,T$ 60990T%=FNmousef:IFT%<=0THEN 61000SYSswi%,sd67_%,"Pic"TOG% 61010T%=G% 61020ENDIF 61030IFT%<=0PROCerr(64) 61040T$=FNu(FNfname(T%)) 61050IFLEFT$(T$,3)<>"PIC"ORRIGHT$(T$)<"0"ORRIGHT$(T$)>"9"PROCerr(64) 61060PROCpfield(T%,FNfirstspr(A$)+","+FNleaf(A$)):ENDPROC 61070 61080DEFFNtrans(A$):LOCALT%,A%:A%=END+100 61090SYS"OS_GSTrans",A$,A%,255 TO,,T%:T%?A%=13:=$A% 61100 61110DEFPROCmarkidx(G%):IFw%(file%,5)<=0ORG%=lix%ENDPROC 61120IFG%>0PROCupdidx1(G%) 61130IFlix%>0PROCupdidx1(lix%) 61140ENDPROC 61150 61160DEFPROCupdidx1(T%) 61170!q%=w%(file%,5):q%!4=0:q%!8=-margin%-T%*linegap% 61180q%!12=1E9:q%!16=q%!8+linegap%+4:PROCredraw(TRUE):ENDPROC 61190 61200DEFFNcuridx:LOCALT% 61210SYSswi%,istat_%,-1TOG%,T% 61220=T% 61230 61240DEFFNaddfield(T$,T%) 61250LOCALC%,t$,A$:t$=T$:WHILERIGHT$(t$)=" ":t$=LEFT$(t$):ENDWHILE 61260IFt$="":=FNfname1(T%) 61270IFRIGHT$(t$)="@"ORRIGHT$(t$)="#":=t$+FNfname(T%) 61280C%=FALSE:RESTORE+1:REPEAT:READA$:C%=RIGHT$(t$,LENA$)=A$ 61290UNTILC%ORA$="****":IFNOTC%T$+="+" 61300IFINSTR(T$,"@"):=T$+"@"+FNfname(T%) 61310IFINSTR(T$,"#"):=T$+"#"+FNfname(T%) 61320=T$+FNfname1(T%) 61330DATA+,-,*,/,AND,OR,NOT,>,<,=,(,",",":",**** 61340 61350DEFPROCwaitkey:LOCALA%,B%,C% 61360REPEAT:MOUSEB%,B%,C%:IFC%=0A%+=1:ELSEA%=0 61370UNTILINKEY0<0ANDC%=0ANDA%>20 61380REPEAT:MOUSEA%,B%,C%:G%=INKEY0:UNTILG%>=0ORC%<>0 61390ENDPROC 61400 61410DEFPROCreadflags:LOCALT$:T$=FNArfVar("MultiStore$Flags") 61420PROCstrflg(LEFT$(T$,1),sound%):PROCstrflg(MID$(T$,2,1),stopboxes%) 61430PROCstrflg(MID$(T$,3,1),shadows%):PROCstrflg(MID$(T$,4,1),pix%) 61440*unset MultiStore$Flags 61450ENDPROC 61460 61470DEFPROCwriteflags:LOCALT$ 61480T$=FNflgstr(sound%)+FNflgstr(stopboxes%)+FNflgstr(shadows%)+FNflgstr(pix%) 61490OSCLI"*Set MultiStore$Flags "+T$:ENDPROC 61500 61510DEFFNflgstr(T%):IFT%:="*":ELSE="-" 61520 61530DEFPROCstrflg(T$,RETURN T%) 61540IFT$="*":T%=TRUE:ELSEIFT$="-"T%=FALSE 61550ENDPROC 61560 61570DEFPROCcsize:w_csize%=FNcrwind(tw_csize%) 61580SYSswi%,sd57_%,"Width"TOG% 61590PROCseti(w_csize%,61,STR$G%) 61600SYSswi%,sd57_%,"Height"TOG% 61610PROCseti(w_csize%,57,STR$G%) 61620PROCdialogue(w_csize%):ENDPROC 61630 61640DEFPROCnovars 61650ENDPROC 61660 61670DEFPROCimportasc:LOCALX%:X%=OPENUPfile$:IFX%=0:ENDPROC 61680LOCALERROR:ONERRORLOCAL:RESTOREERROR:PROCendimport:PROCerr(65) 61690*fx229 61700PROCselsub(0):PROCnofilt:PROCreadasc 61710DEFPROCendimport 61720*fx229,1 61730PROCselsub(0):PROCnofilt:PROCvalidrec:PROCgraph:PROCforcerep:ENDPROC 61740 61750DEFPROCreadasc:LOCALT%,f%,I%,Q%,L%,A%,B%,f$ 61760LOCALERROR:ONERRORLOCAL:RESTOREERROR:CLOSE#X%:X%=0:PROCerr(0) 61770I%=TRUE:f%=1:T%=FALSE:Q%=FALSE:L%=-1:A%=TRUE 61780REPEAT:REPEAT:B%=FNabget:IFsep%:f%+=1:IFB%=10:f%=1:A%=TRUE 61790UNTIL(B%>32ANDB%<127ANDNOTsep%)OREOF#X% 61800IFNOTEOF#X%THEN 61810f$=CHR$B%:REPEAT:B%=FNabget 61820IFB%>31ANDB%<127ANDNOTsep%ANDLENf$<255:f$+=CHR$B% 61830UNTILsep%:IFNOTI%ORB%<>10ORf%<>1THEN 61840IFNOTT%:IFLENf$>1:IFASCf$=34:IFASCRIGHT$(f$)=34:f$=MID$(f$,2,LENf$-2) 61850IFA%:A%=FALSE:SYSswi%,add_%TON% 61860$sd%=f$:IFf%<=FNv_(7):SYSswi%,pfield_%,f% 61870ENDIF 61880I%=FALSE:f%+=1:IFB%=10:f%=1:A%=TRUE 61890ENDIF 61900UNTILEOF#X%ORINKEY0=27:CLOSE#X%:X%=0:ENDPROC 61910 61920DEFFNabget:LOCALB% 61930IFEOF#X%B%=10:ELSE:REPEAT:B%=BGET#X%:IFB%=13:B%=10:UNTILB%<>10ORB%<>L%OREOF#X% 61940IFB%=10:L%=B%:ELSEL%=-1:IFB%=34:Q%=NOTQ% 61950IFB%=9:T%=TRUE 61960sep%=B%=9ORB%=10OR(B%=44ANDNOTT%ANDNOTQ%):=B% 61970 61980DEFPROCpicpath:LOCALT$:IFLENfile$>230:ENDPROC 61990T$=FNArfVar("MultiStorePics$Path"):IFINSTR(FNu(T$),FNu(file$)):ENDPROC 62000file$+=".":WHILELENT$+LENfile$>229 62010REPEAT:T$=LEFT$(T$):UNTILRIGHT$(T$)=","ORT$="":T$=LEFT$(T$) 62020ENDWHILE:IFT$>"":file$+="," 62030OSCLI"Set MultiStorePics$Path "+file$+T$ 62040FORI%=0TOmaxf%:IFw%(I%,0)>0PROCforce(w%(I%,0)) 62050NEXT:ENDPROC 62060 62070DEFFNstatstr:LOCALT$,A%:A%=st%(file%,1) 62080T$=""""+FNfilename+""","+STR$st%(file%,0)+","+STR$A%+","""+FNfilename 62090T$+=" has been opened "+FNnumber(st%(file%,0))+" times for a total of " 62100T$+=STR$(A%DIV3600)+"h "+STR$((A%MOD3600)DIV60)+"m "+STR$(A%MOD60)+"s""" 62110=T$ 62120 62130DEFFNevaluation:SYSswi%,sd55_% 62140SYSswi%,upper_% 62150=INSTR($sd%,"EVALUATION")<>0 62160 62170DEFPROCwritecomm(h%) 62180LOCALA$:A$="":T%=0:REPEAT 62190IFw%(T%,0)>0:IFA$=""A$=fn$(T%):T%=maxf% 62200ENDIF 62210T%+=1:UNTILT%>maxf%:A$="/"+LEFT$(FNdir)+" "+A$ 62220BPUT#h%,A$:ENDPROC 62230 62240DEFPROCsetvar(A%,V%) 62250CASEA%OF 62260WHEN 0:a%=V% 62270WHEN 1:b%=V% 62280WHEN 2:c%=V% 62290WHEN 3:d%=V% 62300WHEN 4:e%=V% 62310WHEN 5:f%=V% 62320WHEN 6:g%=V% 62330WHEN 7:h%=V% 62340WHEN 8:i%=V% 62350WHEN 9:j%=V% 62360WHEN10:k%=V% 62370WHEN11:l%=V% 62380WHEN12:m%=V% 62390WHEN13:n%=V% 62400ENDCASE 62410ENDPROC 62420 62430DEFPROCsd03(A$) 62440GCOL1:RECTANGLEFILL0,0,32767,31 62450COLOUR129:COLOUR7:PRINTTAB(1,31)A$;:COLOUR128 62460ENDPROC 62470 62480DEFFNp_addcheck(A$) 62490LOCALA%,C%:C%=&5A 62500IFA$>""THEN 62510FORI%=1TOLENA$:A%=ASCMID$(A$,I%) 62520C%=(((C%<<1)OR(C%>>7))EORA%)AND255:IFC%<32ORC%=127:C%=C%OR32 62530NEXT 62540ENDIF 62550=A$+CHR$C% 62560 62570DEFFNp_hexstr(A$) 62580LOCALT$,I% 62590IFA$>"":FORI%=1TOLENA$:T$+=RIGHT$("0"+STR$~ASCMID$(A$,I%),2):NEXT 62600=T$ 62610 62620DEFFNp_prcode(A$)=FNp_hexstr(FNp_addcheck(A$)) 62630 62640DEFFNp_passcode(A$) 62650LOCALX%,C%:X%=OPENINA$:IFX%=0:="" 62660PTR#X%=44*4:A$="":REPEAT:C%=BGET#X%:IFC%:A$+=CHR$C% 62670UNTILC%=0ORLENA$=12:CLOSE#X%:=FNp_prcode(A$) 62680 62690DEFPROCcard:IFNOTINKEY-3:ENDPROC 62700IFINKEY-1:PROCmaketext:ENDPROC 62710LOCALI%,X%,T$,A$ 62720LOCALERROR 62730ONERRORLOCAL:RESTOREERROR:PROCcclose(X%):ERRORERR,REPORT$+" ("+STR$ERL+")" 62740FORI%=1TOdepth%:label$(I%)="":NEXT:I%=1:RESTORE+1 62750READA$:WHILEI%<=depth%ANDA$<>"*" 62760T$=FNcfield(A$):IFT$>"":label$(I%)=T$:I%+=1 62770READA$:ENDWHILE 62780IFI%>1THEN 62790*ps 0.254 62800X%=OPENOUT("netprint:"):IFX%=0:ERROR99,"Couldn't claim printer" 62810BPUT#X%,27:BPUT#X%,"E"; 62820FORI%=1TOdepth%:BPUT#X%,label$(I%):NEXT 62830BPUT#X%,27:BPUT#X%,"F"; 62840I%=X%:X%=0:CLOSE#I% 62850ENDIF 62860ENDPROC 62870DATA Name,Add1,Add2,Add3,Town,Cnty,Cntr,+>Post,* 62880 62890DEFPROCcclose(X%):IFX%:CLOSE#X% 62900ENDPROC 62910 62920DEFFNcfield(A$):LOCALT$,T% 62930LOCALERROR:ONERRORLOCAL:RESTOREERROR:="" 62940IFASCA$=ASC"+":T%=T%OR1:A$=MID$(A$,2) 62950IFASCA$=ASC">":T%=T%OR2:A$=MID$(A$,2) 62960SYSswi%,gfield_%,A$:T$=$sd%:WHILERIGHT$(T$)=" ":T$=LEFT$(T$):ENDWHILE 62970IFT$>""THEN 62980IFT%AND2:T$=" "+T$ 62990IFT%AND1:T$=CHR$14+T$ 63000ENDIF 63010=T$ 63020 63030DEFPROCi_init:IFi_v%:ENDPROC 63040i_v%=0:LOCALERROR:ONERRORLOCAL:RESTOREERROR:i_v%=0:ENDPROC 63050SYS"Impulse_Initialise",3,taskhandle%,"MultiStore",-1TOi_v% 63060DIM i_mth% 200,i_txblock% 300 63070i_tgetfield%=0 63080i_tgetdata%=1 63090i_tgettime%=2 63100P%=i_mth%:[OPT 0 63110EQUD 0; format id 63120FNi_mth(0,i_tgetfield%,"GetField","/A") 63130FNi_mth(0,i_tgetdata%,"GetData","") 63140FNi_mth(0,i_tgettime%,"GetTimeDate","") 63150FNi_mth(-1,-1,"","") 63160align:] 63170i_tok%=0:i_prm%=0:i_obj%=0:i_dead%=0 63180i_tx%=FALSE:i_txptr%=0:i_txcount%=1:i_txtag%=0 63190i_file%=-1:i_merging%=0 63200DIMi_com$(6):i_doc$="":PROCi_def1 63210ENDPROC 63220 63230DEFPROCi_close:i_v%=i_v%:IFi_v%=0:ENDPROC 63240SYS"Impulse_CloseDown",taskhandle%:i_v%=0:ENDPROC 63250 63260DEFPROCi_reply(T%) 63270IFT%=i_merging%:i_merging%+=1:i_dead%=0 63280ENDPROC 63290 63300DEFPROCi_send(T$,T%) 63310LOCALM%:M%=&200:IFT%<>-1M%=&201 63320i_dead%=0:SYS"Impulse_SendMessage",M%,T$,0,0,0,T%,taskhandle%,0 63330ENDPROC 63340 63350DEFPROCi_senddata(T%,B%,S%) 63360LOCALZ%:IFNOTi_tx%OR(T%<>i_txtag%):PROCerr(70) 63370i_dead%=0:Z%=i_txtop%-i_txptr%:IFZ%<S%ORZ%=0:i_tx%=FALSE 63380IFZ%>S%Z%=S% 63390SYS"Impulse_TransmitData",i_txptr%+i_txblock%,Z%,,,,,taskhandle% 63400i_txptr%+=Z%:ENDPROC 63410 63420DEFPROCi_receivedata(q%) 63430ENDPROC 63440 63450DEFFNi_mth(F%,T%,M$,S$) 63460[OPT0:equd F%:equd T%:equs M$+CHR$0:equs S$+CHR$0:align:]:=0 63470 63480DEFPROCi_command(T%,P%,O%) 63490CASET%OF 63500WHEN i_tgetfield%:PROCgetfield(P%,O%) 63510WHEN i_tgetdata% :PROCgetdata(P%,O%) 63520WHEN i_tgettime% :PROCgettimedate(P%,O%) 63530ENDCASE:ENDPROC 63540 63550DEFPROCi_transfield(T$) 63560LOCALE%:E%=FALSE 63570LOCALERROR:ONERRORLOCAL:RESTOREERROR:E%=TRUE:T$="[*ERROR* "+REPORT$+"]" 63580IFE%=FALSE:T$=FNevgen(T$,TRUE,FALSE,&90A,TRUE) 63590PROCtransreply(T$,E%AND(1<<31)) 63600ENDPROC 63610 63620DEFPROCgetfield(P%,O%) 63630DEFPROCgetdata(P%,O%) 63640IFP%=-1:ENDPROC 63650LOCALT$:T$=FNzts(O%):PROCi_file(T$) 63660T$=FNzts(!P%):PROCi_transfield(T$) 63670ENDPROC 63680 63690DEFPROCgettimedate(P%,O%) 63700LOCALT$:T$=FNzts(P%) 63710IFT$=""T$="%ZDY%ST %MO %CE%YR" 63720!workbuf%=3:SYS "OS_Word",14,workbuf% 63730SYS "OS_ConvertDateAndTime",workbuf%,workbuf%+20,1400,T$ 63740PROCtransreply(FNzts(workbuf%+20),0):ENDPROC 63750 63760DEFPROCtransreply(T$,F%) 63770i_dead%=0:i_tx%=TRUE:i_txptr%=0:$i_txblock%=T$+STRING$(4,CHR$0) 63780i_txtop%=(LEN(T$)+1+3)AND&FFFFFFFC:i_txtag%=i_txcount%:i_txcount%+=1 63790SYS "Impulse_SendMessage",&202,"MultiStore",-1,,F%,i_txtag%,taskhandle%,i_txtop%-i_txptr% 63800ENDPROC 63810 63820DEFPROCi_file(T$):LOCALT%:IFT$>""THEN 63830T%=FNfilenum(T$):IFT%>=0:PROCsdfile(T%) 63840ELSE 63850IFi_file%>=0:PROCsdfile(i_file%) 63860ENDIF:ENDPROC 63870 63880DEFPROCi_startmerge:PROCi_init 63890PROCi_geticons:IFi_doc$="":PROCerr(71) 63900i_dead%=0:i_file%=dialfile%:PROCnodial 63910i_merging%=1:PROCsdfile(i_file%):PROCstartact(11) 63920ENDPROC 63930 63940DEFPROCi_def:LOCALI%,J%:FORI%=0TO6:READi_com$(I%):NEXT 63950PROCi_seticons:ENDPROC 63960 63970DEFPROCi_def1:RESTORE+1:PROCi_def:ENDPROC 63980DATA ":Impression.<Object> Edit Off" 63990DATA 64000DATA ":Impression.<Object> Merge" 64010DATA ":Impression.<Object> Print" 64020DATA 64030DATA ":Impression.<Object> Edit On" 64040DATA 64050 64060DEFPROCi_impulse:PROCi_init:IFi_v%=0:ENDPROC 64070PROCdialogue(w_impulse%):PROCi_seticons:ENDPROC 64080 64090DEFPROCi_seticons:IFdialogue%<>w_impulse%:ENDPROC 64100RESTORE+1:FORI%=0TO6:READJ%:PROCseti(w_impulse%,J%,i_com$(I%)):NEXT 64110PROCseti(w_impulse%,9,i_doc$):ENDPROC 64120DEFPROCi_geticons 64130RESTORE+1:FORI%=0TO6:READJ%:i_com$(I%)=FNs($FNia(w_impulse%,J%)):NEXT 64140i_doc$=FNs($FNia(w_impulse%,9)):ENDPROC 64150ENDPROC 64160DATA11,12,14,15,16,17,18 64170 64180DEFPROCi_next 64190PROCsdfile(i_file%) 64200CASEi_merging%OF 64210WHEN01:PROCi_nextcom(0) 64220WHEN02:PROCi_safe 64230WHEN03:PROCi_nextcom(1) 64240WHEN04:PROCi_safe 64250WHEN05:SYSswi%,first_%:i_merging%+=1 64260WHEN06:PROCsdnext:IFFNv_(15)>FNv_(17):i_merging%=100:ELSEi_merging%+=1:PROCshownum 64270WHEN07:PROCi_nextcom(2) 64280WHEN08:PROCi_safe 64290WHEN09:PROCi_nextcom(3) 64300WHEN10:PROCi_safe 64310WHEN11:PROCi_nextcom(4) 64320WHEN12:PROCi_safe 64330WHEN13:i_merging%=6 64340WHEN100:PROCi_nextcom(5) 64350WHEN101:PROCi_safe 64360WHEN102:PROCi_nextcom(6) 64370WHEN103:PROCi_safe 64380WHEN104:i_merging%=0:i_file%=-1:PROCendact 64390ENDCASE 64400ENDPROC 64410 64420DEFPROCi_nextcom(C%):LOCALT$ 64430i_merging%+=1:T$=FNs(FNi_translate(i_com$(C%))) 64440IFT$="":i_merging%+=1:ELSEPROCi_send(T$,i_merging%) 64450ENDPROC 64460 64470DEFPROCi_safe:i_dead%+=1 64480IFi_dead%<i_maxdead%:ENDPROC 64490i_dead%=0:i_merging%+=1:ENDPROC 64500 64510DEFFNi_translate(T$):LOCALI% 64520REPEAT:I%=INSTR(T$,"<Object>") 64530IFI%T$=LEFT$(T$,I%-1)+i_doc$+MID$(T$,I%+8) 64540UNTILI%=0:=T$ 64550 64560DEFPROCi_kill(F%):LOCALT$ 64570IFi_merging%=0ORi_file%<>F%:ENDPROC 64580T$=FNs(FNi_translate(i_com$(5))):IFT$>""PROCi_send(T$,-1) 64590T$=FNs(FNi_translate(i_com$(6))):IFT$>""PROCi_send(T$,-1) 64600PROCsdfile(i_file%):i_merging%=0:i_file%=-1:PROCendact:ENDPROC 64610 64620DEFFNdupval:IFFNcuridx>0:=FNev4($sd%,TRUE,TRUE):ELSE=FNso(FNv_(15)) 64630 64640DEFPROCdupnext:LOCALT$,T%,N%:T$=FNdupval:T%=e%(file%,1):N%=FNv_(15) 64650g%=0:IFG%=0ANDex$(file%)<>"#$%$#":g%=FNsimilar(T$,MID$(ex$(file%),INSTR(ex$(file%),":")+1)) 64660IFg%<>0ORT%>255PROCsubbyte(T%,g%):SYSswi%,grec_%,VALex$(file%):PROCsubbyte(T%,g%):SYSswi%,grec_%,N% 64670IFg%<>0ANDT%<255:fc%(file%)+=1:PROCshowfound 64680ex$(file%)=STR$N%+":"+T$ 64690PROCshownum:ENDPROC 64700 64730DEFPROCtext_newl(T%,F%):text_x%=0:text_y%=1023-VPOS*32 64741GCOL7:RECTANGLEFILLtext_x%,text_y%,2112*T%/F%,-31:ENDPROC 64770 64780DEFPROCtext_pstr(T$,W%):IFT$="":ENDPROC 64781LOCALx,s,I%:x=text_x%:s=2112/W%:VDU5,23,17,7,7,1056/W%;8;0; 64791FORI%=1TOLENT$:MOVEx,text_y%:GCOL3,3:VDUASCMID$(T$,I%):x+=s:NEXT 64810text_x%+=2112*LENT$/W%:VDU4,23,17,7,7,8;8;0;:OFF:ENDPROC
"�> <MultiStore$Dir>.MultiStore ?� By Merlyn Kline for Copyright (c) Minerva Software, 1989 : version$="2.02" ( 21�:�error(�,�$+" - Failed to initialise",�,�) < �init F3�:�error(�,�$,�,process%<4�process%>0):�report P�normpoint Z d� n�process%>0:�process x(ș"Wimp_PollIdle",,q%,delay%�reason% ���taskhandle%>0șswi%,selecttask_%,taskhandle%:�i_v%ș"Impulse_Decode",reason%,q%,,,,i_mth%,taskhandle%�reason%,,,,,i_tok%,i_prm%,i_obj% ��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/�&200,&201:�i_command(i_tok%,i_prm%,i_obj%) |�&202:�i_reply(i_tok%) �+�&203:�i_senddata(i_tok%,i_prm%,i_obj%) ��&204:�i_receivedata(q%) �� ��normpoint �� � ���quit(T%):�normpoint �I�(�-3��debug):�i_close:$q%="TASK":ș"Wimp_CloseDown",taskhandle%,!q% ��T%��debug:�tidy:� � �:Ș �!șswi%,killtask_%,taskhandle% �Ș � 0ݤtask:绤ArfVar("MultiStore$Function")<0:=0 =otask% & ��init 0otask%=Z%:�swinums :,appl$="MultiStore":pstream%=0:�releasepr D�:��:��:�err(67) N'� q% 2500, workbuf% 1500,dialct% 24 X�� b7waiter%=0:file%=-1:v%=�initwimp:�v%<180:�12:�err(2) l!�waitpoint:ț(�dir+"BaseLib") vț(�dir+"SwiList"):�swilist �4quit%=�:dialreason%=-1:dialogue%=-1:dialfile%=-1 �ackpending%=�:ackref%=-1 �dragreason%=-1:help$="" �savereason%=-1:savefile%=-1 �file2%=-1:reason2%=-1 �menufile%=-1:menusub%=-1 �closeok%=� �sbfile%=-1:pass$="" �-pdriver%=�:ș"OS_Byte",182,0,255 �,pterm% �0�(pterm%�&80)=0ș"OS_Byte",246,0,255�,pterm% � �pterm%=10pterm%=1:�pterm%=2 ��:��:��:�err(67) �J�PDfname$(10),PDfont$(10),PDcpl%(10),PDfrom%(10),PDto$(10),PDclen%(10) $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\-+." 4,edrep%=�:ss%=12:lc%=3:�readparams:�wvars >4�loadsprites:�defws:�defmenus:�version:�filevars Hi_v%=0:�i_init R$process%=1:checkref%=-1:delay%=0 \$stopfile%=-1:lastact%=0:chunk%=7 fIas$="Are you sure ?":rl$="Really ":ri$=rl$+"interrupt ?":fi$="File: " plastspr$="":lix%=-1 zdepth%=9:�label$(depth%) �)$t_impulse%="":i_merging%=0:i_file%=0 ��:��:��:�err(67) �7�tone%(11,1):�+1:�I%=0�11:�J%=0�1:�tone%(I%,J%):�:� ��� ��readflags:�baricon �� �@�24063,26145,22288,25564,22288,26145,22288,26726,22979,25564 �@�22979,26145,22979,26726,23482,25564,23482,26145,23482,26726 ��24063,25564,24063,26726 � � ��swinums �� ��wvars � ;{n $<� ;{n window handles in w%(maxf%,maxw%) - <=0 = Deleted .A� ;{n (,0)=Card (,1)=Pane (,2)=Subsets (,3)=Report 8@� ;{n (,4)=Fields (,5)=Indices (,6)=Notepad (,7)=Macro B;� ;{n tw%(maxf%,maxw%) template pointers for windows L.� ;{n maxw% = max array index (windows) V,� ;{n maxf% = max array index (files) ` � ;{n jmaxw%=7 t%�tw%(maxf%,maxw%),w%(maxf%,maxw%) ~� � ���filevars �2� ;{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) �1� ;{n (2=background action) �%� ;{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 ex$(maxf%)=search expressions after expansion /� ;{n+ w$(maxf%,14)=wordpro o/p expressions &� ;{n+ wo%(maxf%)=wordpro o/p type � ;{n fn$(maxf%)=file names ( � ;{n+ r%(maxf%)=report mode 25� ;{n 0 = Cards 1 = Sheet 2 = Formula <3� ;{n 3 = Labels 4 = Wordpro 5 = Paged FI� ;{n a%(maxf%)=background action in this file, -ve=linked to action P� ;{n 0 = none Z� ;{n 1 = fast forward d� ;{n 2 = fast back n� ;{n 3 = searching x*� ;{n 4 = clearing/filling subset �!� ;{n 5 = copying subset �$� ;{n 6 = combining subsets �"� ;{n 7 = Deleting subset �!� ;{n 8 = updating cards � � ;{n 9 = sorting cards �"� ;{n 10 = printing report �8� ;{n e%(maxf%,2)=background activity status stuff: �G� ;{n act e%(file%,0) e%(file%,1) e%(file%,2) �A� ;{n 3 source subset target subset recno �A� ;{n 4 target subset clear/fill flag recno �A� ;{n 5/6 source subset target subset recno �"� ;{n 7 target subset �A� ;{n 8 recno A� ;{n 10 label line last label copy# recno 9� ;{n fc%(maxf%)=fast find, number found last search $� ;{n fl%(maxf%)=boolean flags: "� ;{n+ bit 0=filter on ,!� ;{n bit 1=tool pane on 6)� ;{n+ bit 2=macro browse mode on @'� ;{n+ bit 3=macro edit mode on J*� ;{n+ bit 4=filter space strip on T(� ;{n+ bit 5=filter uppercase on ^*� ;{n+ bit 6=search space strip on h(� ;{n+ bit 7=search uppercase on r*� ;{n bit 8=search, add to subset |*� ;{n+ bit 9=report space strip on �(� ;{n+ bit10=report uppercase on �.� ;{n+ bit11=sheet report uppercase on �+� ;{n+ bit12=sheet report totals on �+� ;{n+ bit13=sheet report titles on �+� ;{n+ bit14=sheet report dashes on �2� ;{n+ bit15=wordpro output space stripped �-� ;{n+ bit16=wordpro output uppercase �2� ;{n+ bit17=wordpro output blank stripped �,� ;{n+ bit18=7-bit data in this file �0� ;{n+ bit19=paged report - eject before �/� ;{n+ bit20= " " - eject after �0� ;{n+ bit21= " " - double space �0� ;{n+ bit22= " " - top page nos 2� ;{n+ bit23= " " - bott. page nos .� ;{n+ bit24= " " - print date 7� ;{n+ bit25= " " - totals: Page groups &8� ;{n+ bit26= " " - totals: Summary only 03� ;{n+ bit27= " " - link: duplicate :1� ;{n+ bit28= " " - link: summary D.� ;{n bit29=this file has a pic field N2� ;{n+ t%(maxf%,3)=global variables for macros X%� ;{n+ o$(maxf%)=sort expressions b6� ;{n ox$(maxf%)=sort expressions after expansion lH� ;{n+ o%(maxf%,6)=sort stuff (index 0,bit 0=ascend,bit 1=uppercase) v:� ;{n+ r$(maxf%)=report expressions, old style complex �8� ;{n rx$(maxf%)=report expressions after expansion �.� ;{n+ sr$(maxf%)=simple report field list �?� ;{n srx$(maxf%)=simple report field list after expansion �7� ;{n l%(maxf%)=link file+1 (0=none, -ve=unlinked) �2� ;{n+ l$(maxf%)=link expression for this file �D� ;{n+ lx$(maxf%)=expanded link expression. Also, link file name �� ;{n+ lk$(maxf%)=link key �F� ;{n+ ll%(maxf%,7)=labels wid/mar/gap/dep/across/copies/lead/drop �7� ;{n+ lf%(maxf%,15)=label line flags for 16 lines: �+� ;{n bits 0..1 = L/C/R Justify �&� ;{n bits 2..3 = Font No. �)� ;{n bit 4 = Space Strip �'� ;{n bit 5 = Uppercase #� ;{n bit 6 = fixed 8� ;{n l1%(maxf%,maxacr%-1)=line pointers for labels :� ;{n+ p%(maxf%,4)=paged rep. pwid/marg/twid/tlen/plen J� ;{n+ p$(maxf%,7)=paged rep. 4*header,subtot,subhead,ssubtot,ssubhead *<� ;{n+ c$(maxf%,maxcol%,1)=paged rep. col exprs, headers 43� ;{n+ c%(maxf%,maxcol%)=paged rep col formats: >'� ;{n bit 00-07 = Col width HC� ;{n bit 08-09 = Justification 0/1/2=Left/Centre/Right R)� ;{n bit 10-11 = Font number \'� ;{n bit 12 = Uppercase f)� ;{n bit 13 = Space strip p7� ;{n bit 14-16 = decimal places (7=string) z'� ;{n bit 17 = totals on �)� ;{n bit 18 = averages on �*� ;{n bit 19 = blank zeroes �+� ;{n bit 20 = insert commas �>� ;{n bit 21-23 = format (0-7) S/(-/b-/b+/-A/*/`/$ �F� ;{n ct(maxcol%,2)=paged rep col tots,subtots,subsubtots,summary �C� ;{n ct%(maxcol%,2)=paged rep col tots entry counts (for avg) �D� ;{n cv$(maxcol%,1)=paged rep column values, previous col vals �/� ;{n rl%(maxf%)=link map for paged report �3� ;{n rs%(maxf%*2)=link stack for paged report �&� ;{n m$(maxf%)=search mode flags �"� ;{n+ st%(maxf%,2)=file stats � � ;{n �.� ;{n maxf% = max array index (files) ,� ;{n maxacr% = max labels across web =� ;{n maxcol% = max array index (paged report columns) � ;{n $�:��:��:�err(67) .8� h%(maxf%),f%(maxf%),s%(maxf%),s$(maxf%),fc%(maxf%) 8H� fl%(maxf%),a%(maxf%),d$(maxf%,23),f$(maxf%),fx$(maxf%),t%(maxf%,3) BG� e$(maxf%),ex$(maxf%),e%(maxf%,2),r%(maxf%),m$(maxf%),st%(maxf%,2) LF� o$(maxf%),ox$(maxf%),o%(maxf%,6),r$(maxf%),rx$(maxf%),fn$(maxf%) VG� l%(maxf%),l$(maxf%),lx$(maxf%),lk$(maxf%),rl%(maxf%),rs%(maxf%*2) `L� sr$(maxf%),srx$(maxf%),ll%(maxf%,7),lf%(maxf%,15),l1%(maxf%,maxacr%-1) jG� w$(maxf%,14),wo%(maxf%),p%(maxf%,4),p$(maxf%,7),c%(maxf%,maxcol%) tE� c$(maxf%,maxcol%,1),ct(maxcol%,3),ct%(maxcol%,3),cv$(maxcol%,1) ~�� �;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:f_pics%=1<<29 �[f_reps%=f_rldu%�f_rlsu%�f_rejb%�f_reja%�f_rdsp%�f_rtpn%�f_rbpn%�f_rpdt%�f_rtpg%�f_rtsu% �!f_save%=-1��(f_pane%�f_sadd%) �Kf_dflt%=f_fspc%�f_fupp%�f_sspc%�f_supp%�f_stot%�f_stit%�f_sdas%�f_wspc% �'ft_form%=&DE7:ft_data%=&DE8:maxw%=7 � ��sdvars șswi%,sd64_%,3�linegap% (margin%=8:�v_(1)=1:�err(3) 2+�sound%:șswi%,opt_%,10:�șswi%,opt_%,9 <8date%=�nyear(�now)*10000+�nmon(�now)*100+�nday(�now) F� P Z)��checkprot:ș"FlexiFile_Address"�sd% d�:��:process%=2:� nșswi%,reset_%,taskhandle% xW�process%=3�stop(1,"OK. Please remove original &","replace backup if necessary",-1) �0date$=�strdate1(�now,4):�sdvars:process%=4:� � � ��version �/�T$:T$=version$:笤prod:T$+=" *UNFINISHED*" �8�seti(w_pinfo%,4,"v"+T$):$�tia(tw_status%,11)="v"+T$ �� � �,ݤprod=�version$,�version$,".")+1,1)="0" �ݤdebug=��prod ��-1��-2 � �>ݤinitwimp:first%=�:taskhandle%=�task:�taskhandle%<>0:=200 �G$q%="TASK":ș"Wimp_Initialise",200,!q%,"MultiStore"�!q%,taskhandle% �first%=�:=!q% ��tidy �:�normpoint "�4,26:�0,3);:*fx4 ,*fx225,1 6 *fx229 @Z%=0:șswi%,killtask_% J ��:� T+�;menuend%-menufree%" bytes menu space" ^6�;endbuf%-curbuf%" bytes indirection buffer space" h'�;tbe%-tbs%" bytes template buffer" r� | ���baricon:�first%:� �+!q%=-1:q%!4=0:q%!8=0:q%!12=102:q%!16=68 �0q%!20=%11000000000010:$(q%+24)="!"+�appl$,9) �$ș"Wimp_CreateIcon",,q%�baricon% �� � ���strip(� T$) �$sd%=T$:șswi%,strip_% �T$=$sd% �� � �!��error(err%,err$,erl%,quit%) �*�debug:�4,30:�err$" @ ";erl%:�quit(�) .�normpoint:dragreason%=-1:@%=&90A:*fx229,1 �i%,e%,t$,T$ 笤prod:err$+=" ("+Þ+")" &� 0��:�error(�,�$,�,�) :B!q%=err%:$(q%+4)=err$:ș"Wimp_ReportError",q%,1,appl$:line$="" D�quit%:�quit(�) N� X b+��report:�debug:�4:�:�" @ ";�:�quit(�) l� v � ݤdir � �T$:T$=�ArfVar(appl$+"$Dir") �!�T$="":T$="&.!"+�appl$,9)+"." ���T$)<>".":T$+="." �=T$ � �ݤArfVar(A$):�L%,V% �=ș"XOS_ReadVarVal",A$,workbuf%,254,0,3�,,L%;V%:�V%�1:L%=0 �workbuf%?L%=13:=$workbuf% � ���umess1 �-ref%=q%!8:task%=q%!4:�task%=taskhandle%:� �mess%=q%!16 Ȏmess%� �0:�CLOSE:�quit(�) �1:�datasaved �2:�savedata *�3:�dataload 4�4:ackpending%=� >�5:�dataopen H�6: R�7: \�8:�prequit f�9: p�10:�writecomm(q%!20) z �&502: �-�&400C0:�submenu(q%!20,q%!24,q%!28,q%+32) ��&80300:�ackrec �� �� � ���dataopen �(�q%!40=ft_form%:�dataloadack:�err(1) ��q%!40<>ft_data%:� ��dataloadack:mh%=-1 �D�process%=0:笤dialogue:�openfile1(�zts(q%+44),0,0,"",readonly%) �� � ���dataload �T%:del%=q%!12<>0 �readpointer:�wtof(mh%) Ȏ � � $<� q%!40=&FF9 �wind%=0:�dataloadack:�loadspr(�zts(q%+44)) .T� q%!40=&1000:file$=�zts(q%+44):�stop(38,�file$,29),rl$+"set picture path ?",-1) 8#� q%!40=&2000:file$=�zts(q%+44) B痤leaf(file$)=33� L$T%=�(file$+".!DocData"):�T%:�#T% VA�T%�i_merging%=0:i_doc$=��leaf(file$),2):�file%>=0:�i_impulse `�i_seticons j� t� q%!40=ft_data%�mh%=-2 ~?�dataloadack:�process%=0:笤dialogue:�openfile(�zts(q%+44)) �� q%!40=&FFD �mh%=-2 �3�process%=0:笤dialogue:�checkconv(�zts(q%+44)) �0� q%!40=ft_form%�mh%=-2:�dataloadack:�err(1) �<� q%!40=ft_form%�file%>=0�wind%<2:�dataloadack:�openform �r� q%!40=&FFF �file%>=0�wind%=6:�dataloadack:file$=�zts(q%+44):�stop(14,fi$+�filename,rl$+"load notes ?",file%) �t� file%>=0�wind%=1�mi%=17:�dataloadack:file$=�zts(q%+44):�stop(37,fi$+�filename,rl$+"import ASCII file ?",file%) �r� q%!40=&FFF �file%>=0�wind%=7:�dataloadack:file$=�zts(q%+44):�stop(19,fi$+�filename,rl$+"load macro ?",file%) �h� q%!40=&FFF �file%=edfile%�file%>=0�wind%=-3*edrep%�edicon%>=0:�dataloadack:�loadfield(�zts(q%+44)) �w� q%!40=&FFF �file%>=0�wind%=0:�dataloadack:file$=�zts(q%+44):�stop(26,fi$+�filename,rl$+"load ASCII card ?",file%) �:� mh%=w_pdrive%:�dataloadack:file$=�zts(q%+44):�PDload �� q%!40=&D7B:�checksetup �� � ��loadfield(file$) �T$,T% (�:��:� 2T%=�file$:�T%=0:� <ȕT$=""���#T%:T$=�#T%:� F�#T%:�noscrap P+�seti(w%(edfile%,-3*edrep%),edicon%,T$) Z� d n ��noscrap x�del%:*Remove <Wimp$Scrap> �� � ���datasaved ��readpointer:�wtof(mh%) � Ȏ � � �A� q%!40=&FFF �file%>=0�(wind%=6�wind%=7�wind%=0):�datasaveack �#� q%!40=&2000:file$=�zts(q%+44) �#痤leaf(file$)=33�i_merging%=0� �i_doc$=��leaf(file$),2) �5�file%>=0:�i_impulse:��mh%=w_impulse%:�i_seticons �� �� �� ��err(E%) 9�T$,A$:�file%>=0A$=", "+fi$+�filename+" - ":�A$=" - " "@%=&90A:*fx229,1 , ȎE%� 6�0:T$=�$ @0�1:T$="To use a format, drag it onto a card" J-�2:T$="Must be version 1.8 WIMP or later" T.�3:T$="Sorry! Too many files already open" ^A�4:T$="Sorry! You can only run one RAMManager task at a time" hH�5:T$="To save, drag the icon to a directory viewer or another task" rc�6:T$="Couldn't open file: "+�$:�$="Data lost":T$+=" (Ensure the disc is not write protected)" |%�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" 0%�25:T$="Field name not specified" :-�26:T$="Subset value assignment expected" D-�27:T$="Subset name/letter not specified" N'�28:T$="Invalid subset name/letter" X1�29:T$="Illegal notepad reference identifier" b9�30:T$="Abbreviated expression too complex to expand" l%�31:T$="Illegal pattern matching" v>�32:T$="Validating card"+A$+�$+" (Filter/Subset disabled)" �+�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" 4<�51:T$="You must specify the current password correctly" >2�52:T$="Column "+�(column%+1)+" formula"+A$+�$ H+�53:T$="No room to add another column!" R>�54:T$="Plotting picture"+A$+�$+" (release ALT to redraw)" \D�55:T$="Sorry! You can only generate one paged report at a time" f�56:T$="Report interrupted" p$�57:T$="Sub-total formula"+A$+�$ z(�58:T$="Sub-sub-total formula"+A$+�$ ��59:T$="Program not found" �4�60:T$=�$+" - Can't load file creation software" �=�61:T$="Sorry! Not enough subsets available for a search" �4�62:T$=�$+" - Can't load file transfer software" �C�63:T$="That's a Transfer setup file - you can't load it here!" �3�64:T$="Please drag sprites to a picture field" �&�65:T$=�$+" - ASCII import failed" ʾ�66:T$="** WARNING ** This is an evaluation copy of MultiStore. Many features are restricted and it may time-out without warning. You are advised to close any other important tasks now." �*�67:T$=�$+" - Check memory allocation" �-�68:T$=�$+" - Unable to load sprite file" �6�69:T$=�$+" - Unable to load window template file" �:�70:T$="Recieved Impulse request to send unknown data" �-�71:T$="Please specify a target document" :�72:T$="Sorry! That field is not on the linked format" C�73:T$="Sorry! You can't edit a report when a format is linked" � $%笤prod:T$+=" ("+Þ+") ["+�E%+"]" . �99,T$ 8 B��openfile(f$) LAw_open%=�crwind(tw_open%):�unselall(w_open%):�seli(w_open%,1) V6file$=f$:�seti(w_open%,13,f$):�seti(w_open%,14,"") `�dialogue(w_open%):� j t��openfile1(f$,m%,d%,p$,r%) ~!�I%,g%,h%,X%,Y%,T$:p$=�su(p$) ��:��:��:�loaderr:� �h%=-1:�v_(1)/2<=maxf%� �I%=0:ȕ I%<=maxf% ��h%(I%)<=0:h%=I%:I%=maxf%+1 �I%+=1:� �� �5T$=f$:m%=�(99/(maxf%+1)+(99-(99/(maxf%+1)))*m%/7) ��h%<0:�err(3) �-w%(h%,0)=�crwind(tw%(h%,0)):�makepane(h%) ��p$=""p$=�pwcode(pass$) �)pass$=�pwcode(p$):�clearpass%pass$="" �șswi%,password_%,p$ %g%=0:șswi%,open_%,T$,m%,d%,r%�G% %g%=G%:�g%�?sd%<>13��warnfile:g%=� �fillcache%:*FFCacheFill h%(h%)=�v_(2):�initfile (șswi%,selectkey_%,"?" 2șswi%,sd45_%,"N" <>�sdfile(h%):$�ta(w%(h%,0))="File="+�filename:�fext:�readws F3�initpane:X%=h%*80+panew%+8:Y%=900-h%*40-paneh% P>�open(w%(h%,0),X%,Y%,X%+paneh%,Y%+paneh%,0,0,-1):�validrec Zșswi%,sd57_%,"bit7"�G% d9�flg(f_7bit%,G%):�clrmv:�flg(f_pics%,�isfield("PIC")) n$fn$(h%)=f$:�g%�dialogue(w_mess%) x� � ���warnfile �*�T%,t%,I%,T$:w_mess%=�crwind(tw_mess%) ��+1:�I%=0�7:�T$ �)�g%�(2^I%):�seti(w_mess%,T%,T$):T%+=1 ��:�$sd%>""� �J�seti(w_mess%,T%,"Password violations have occured as follows:"):T%+=1 �t%=sd%:� �>�t%<sd%+192:�$t%>"":�seti(w_mess%,T%," Using "+$t%):T%+=1 �t%+=64:�t%=sd%+192 �� �)ȕ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 6?a%(h%)=0:f$(h%)="":fx$(h%)="":e$(h%)="":ex$(h%)="":r%(h%)=1 @Co$(h%)="":o%(h%,0)=3:r$(h%)="":rx$(h%)="":�I%=0�3:t%(h%,I%)=0:� JCl%(h%)=0:l$(h%)="":lk$(h%)="":lx$(h%)="":sr$(h%)="":srx$(h%)="" T/fn$(h%)="":p%(h%,0)=0:p$(h%,0)="":m$(h%)="" ^6�I%=0�23:d$(h%,I%)="":�:�I%=0�18:�note(h%,I%,""):� h)�I%=0�29:�macln(h%,I%,""):�:wo%(h%)=0 r3�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 �+ll%(h%,6)=lab_lead%:ll%(h%,7)=lab_drop% �3fl%(h%)=f_dflt%:�tools%:fl%(h%)=fl%(h%)�f_pane% �� � � ��loaderr ��normpoint:�h%>=0� ��g%:�delw(w_mess%) ��w%(h%,0)>0�delw(w%(h%,0)) ��w%(h%,1)>0�delw(w%(h%,1)) ��h%(h%)>0:�closefile(h%) ��=&80301� �Dw_open%=�crwind(tw_open%):�unselall(w_open%):�seli(w_open%,m%+1) ��d%�seli(w_open%,0) 6file$=f$:�seti(w_open%,13,f$):�seti(w_open%,14,"") �dialogue(w_open%):file%=-1 A�p$="MINERVACODE":�99,"Pass code is '"+�p_passcode(file$)+"'" &� 0� :� Dfile%=-1:�err(6):� N X��closefile(h%):�I% b�i_kill(h%) l0�I%=0�maxf%:�l%(I%)=h%+1:�sdfile(I%):�unlink v*�:�sdfile(h%):�ready:�l%(h%)>0:�unlink �)�closeform:�cf_writews:�delfilews(h%) �>h%(h%)=0:s%(h%)=0:f%(h%)=0:a%(h%)=0:w%(h%,0)=-1E9:l%(h%)=0 �closeok%=� �ș&20000+swi%,close_%�S% �� � ���cf_writews:�:��:��:� ��writews:� � �#��align(h%,I%):�tx1%-tx0%>108:� ���align1(h%,I%) �.tx0%=h%*80+I%*40-40+panew%+8:tx1%=tx0%+440 �)ty1%=900-h%*40-I%*40+40:ty0%=ty1%-320 � ��makepane(h%) )�P%:P%=�crwind(tw%(h%,1)):w%(h%,1)=P% *C�getw(P%):paneh%=y1%-y0%:panew%=x1%-x0%:�wext(P%,panew%,paneh%) 4� > H��makesubs(h%) R�P%,T$,I%,J%,K%,T% \:K%=w%(h%,2)>0:�K%�getw(w%(h%,2))��readblock(tw%(h%,2)) f4tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:�align(h%,2) pA�delfilew(h%,2):P%=�crwind(tw%(h%,2)):w%(h%,2)=P%:�sdfile(h%) z*$�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 �:q%!4=!q%:q%!12+=T%:q%!20+=T%:ș"Wimp_CreateIcon",,q%+4 �� � �:�geti(P%,4):�delicon(P%,4) :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%) C�showsub1:�open(w%(h%,2),tx0%,ty1%-C%,tx1%+x1%-x0%,ty1%,0,0,-1) $� . 8��makerep(h%) B=�P%,X%,Y%:P%=�makewind(h%,3):$�ta(P%)="Report="+�filename L-�sdfile(h%):�repdefault:�rext:�matchrep:� V `��makeflist(h%):�T% j=�P%:P%=�makewind(h%,4):T%=�ta(P%):$T%="Fields="+�filename t*T%=�$T%+4:�formstat:șswi%,sd64_%,1�G% ~�G%<T%G%=T% �9�wext(P%,G%*16+margin%*2,�v_(7)*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%) �8�P%:P%=�makewind(h%,6):$�ta(P%)="Notepad="+�filename �� ��makemacro(h%) 6�P%:P%=�makewind(h%,7):$�ta(P%)="Macro="+�filename � ( 2ݤmakewind(h%,T%):�P%,I%,K% <=K%=w%(h%,T%)>0:�K%�getw(w%(h%,T%))��readblock(tw%(h%,T%)) F5tx0%=x0%:ty0%=y0%:tx1%=x1%:ty1%=y1%:�align(h%,T%) PD�delfilew(h%,T%):P%=�crwind(tw%(h%,T%)):w%(h%,T%)=P%:�sdfile(h%) Z,�open(P%,tx0%,ty0%,tx1%,ty1%,0,0,-1):=P% d n1ݤcrwind(T%):ș"Wimp_CreateWindow",,T%�T%:=T% x ���initpane �)�graph:�seti(w%(file%,1),7,s$(file%)) �7�showsub:�showindex:�showfilter:�showfound:�showmac �� � ���graph ��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 ��shownum:� � ��shownum 1�P%,T%,M%,T$:T%=file%:�sdfile(T%):P%=w%(T%,1) $N%=�v_(15):R%=�v_(17):M%=�v_(16) "(�geti(P%,13):ș"Wimp_DeleteIcon",,q% ,�badrec(N%)� 6T$="??????????":q%!16=10 @� J6T$="C"+�"0000000000"+�N%,�(R%-(R%<1))+1.000000001) T�N%=0:T$="Default" ^�s%(file%)=1:T$="" h"q%!16=6+(326-6)*N%/(M%-(M%=0)) r� |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):�seti(P%,19,�subdesc) ��showsub1:� � � ��showsub1:�P%,M%:M%=�v_(11) �P%=w%(file%,2):�P%>0� �"�subdisp1:�unselall(P%):�M%=0� ��seli(P%,1) �� ��seli(P%,(M%�31)+28) �M%>31:�seli(P%,(M%�31)+4) � � &� 0 :!��showindex:�P%,T%:T%=�curidx D-P%=w%(file%,1):�T%<=0$sd%=" * No Index *" N,�seti(P%,20,$sd%):�markidx(T%):lix%=T%:� X b��showfilter l�P%,T$:P%=w%(file%,1) v@�flg(f_filt%)T$=�trunc(f$(file%),19):�T$=" * No Filter *" ��seti(P%,21,T$) �� � � ��showmac ��P%,T$:P%=w%(file%,1) �*�macmode:�seli(P%,18):��unseli(P%,18) �� � �1ݤtrunc(T$,T%):�T$<=T%:=T$:�=�T$,T%-3)+"..." � ���showfound ��P%:P%=w%(file%,1) ��fc%(file%)<0� #�seti(P%,24,""):�seti(P%,23,"") � 3�seti(P%,23,�(fc%(file%))):�seti(P%,24,"Found") � *� 4 >2��delfilews(h%):�I%:�w%(h%,0)>0�delw(w%(h%,0)) H$�I%=1�maxw%:�delfilew(h%,I%):�:� R \��delfilew(h%,I%) f@�w%(h%,I%)>0:�closew(w%(h%,I%)):�w%(h%,I%)>0�delw(w%(h%,I%)) p� z ���umess2 �Ȏq%!16� �$�6:�q%!8=loadref%:�datasaveack:� �(�&201:�q%!8=i_merging%:i_merging%+=1 �� �� � ���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%:� *lastact%=L%:�sdfile(L%):T%=�:Ȏa%(L%)� �1:�skip(1) $�2:�skip(0) .�3:�srcnext 8�4:�fsubnxt B�5,6:�csubnext(a%(L%)) L�7:�dsubnxt V�8:�updnxt `�9:�sortnext j�10:�printnext t�11:�i_next ~� ��delay%<>(2E9)� �(T%=(�-T%+4)�5:�T%<0T%=0:��T%>50T%=50 �.ș"OS_ReadMonotonicTime"�delay%:delay%+=T% �� �� � ���template(T$) ��template1(T$,q%) �� � �/��template1(T$,q%):T$=�lower(T$):� I%,T%,L% �5I%=temp%+16:ȕ!I%>0��lower($(I%+12))<>T$:I%+=24:� -�!I%<=0:�99,"Template '"+T$+"' not found" CT%=temp%+!I%:L%=I%!4:�I%=0�L%�4:q%!I%=T%!I%:�:T%=q%+88+q%!84*32 �(q%!56)�(1<<8)� 3q%!72=�workspace(q%!80):$(q%!72)=$T%:T%+=�$T%+1 (=�q%!76>0:q%!76=�workspace(�$T%+1):$(q%!76)=$T%:T%+=�$T%+1 2� < �q%!84>0� F�I%=q%+88�q%+84+q%!84*32�32 P�(I%!16)�(1<<8)� Z3I%!20=�workspace(I%!28):$(I%!20)=$T%:T%+=�$T%+1 d=�I%!24>0:I%!24=�workspace(�$T%+1):$(I%!24)=$T%:T%+=�$T%+1 n� x� �� �q%!64=sprites% �� � �ݤtemplate(T$) ��template1(T$,tbs%) �T%=tbs%:tbs%+=88+tbs%!84*32 �)�tbs%>tbe%:�99,"Template buffer full" �=T% � �$��opentemplate(A$):temp%=�-30000 ��:��:��:�err(69) ��"Load "+A$+" "+�~temp%:� ��defws:�I% �:��:��:�err(67) "wts%=6688:wbs%=4413 ,bufsz%=(maxf%+1)*wbs%+8700 6;� buffer% bufsz%:curbuf%=buffer%:endbuf%=buffer%+bufsz% @�� J �opentemplate(�dir+"MSFrm1") T�:��:��:�err(67) ^:�template("stopbox"):ș"Wimp_CreateWindow",,q%�w_stop% h�template("save") r-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% �=�template("Impulse"):ș"Wimp_CreateWindow",,q%�w_impulse% �bufsz%=(maxf%+1)*wts%+19150 �6� template% bufsz%:tbs%=template%:tbe%=tbs%+bufsz% �wbs%=curbuf% ��I%=0�maxf% �tw%(I%,0)=�template("file") �#tw%(I%,1)=�template("filepane") �"tw%(I%,2)=�template("subsets") �$tw%(I%,3)=�template("FieldList") �$tw%(I%,4)=�template("FieldList") �$tw%(I%,5)=�template("FieldList") "tw%(I%,6)=�template("Notepad") tw%(I%,7)=�template("Macro") � &Awbs%=(curbuf%-wbs%)/(maxf%+1):wts%=(tbs%-template%)/(maxf%+1) 0J� ;{n wbs% and wts% now contain the min values to use at start of PROC :�� D �opentemplate(�dir+"MSFrm2") N�:��:��:�err(67) X1tw_expr%=�template("expression"):w_expr%=-1E9 b.tw_nums%=�template("numeric"):w_nums%=-1E9 l+tw_sort%=�template("sort"):w_sort%=-1E9 v+tw_open%=�template("open"):w_open%=-1E9 �0tw_finf%=�template("FieldInfo"):w_finf%=-1E9 �1tw_status%=�template("Status"):w_status%=-1E9 �.tw_rlink%=�template("rlink"):w_rlink%=-1E9 �0tw_srset%=�template("srsetup"):w_srset%=-1E9 �/tw_label%=�template("labels"):w_label%=-1E9 �,tw_line%=�template("lline"):w_line%=-1E9 �.tw_mess%=�template("message"):w_mess%=-1E9 �1tw_passw%=�template("password"):w_passw%=-1E9 �.tw_word%=�template("wordpro"):w_word%=-1E9 �2tw_pdrive%=�template("pdriver"):w_pdrive%=-1E9 �0tw_rset1%=�template("repset1"):w_rset1%=-1E9 �0tw_rset2%=�template("repset2"):w_rset2%=-1E9 �0tw_rset3%=�template("repset3"):w_rset3%=-1E9 !+tw_col%=�template("column"):w_col%=-1E9 !1tw_csize%=�template("cardsize"):w_csize%=-1E9 !� ! !*��loadsprites !4�:��:��:�err(67) !>ssize%=16*1024 !H�sprites% ssize% !R��:��:�err(68) !\2!sprites%=ssize%:ș"OS_SpriteOp",&109,sprites% !f.ș"OS_SpriteOp",&10A,sprites%,�dir+"MSSpr" !p� !z !���defmenus:�t$ !��:��:��:�err(67) !�� mlist% 32,function% 51 !�bufsz%=&AF0 !�C� menufree% bufsz%:menuptr%=menufree%:menuend%=menufree%+bufsz% !��� !�menustart%=menufree%:�+2 !��t$:m_npad%=�crmenu(t$) !�+�"#Notepad,Clear,Export>w_save%,Update" !��t$:m_main%=�crmenu(t$) !�N�"#MultiStore,Info>w_pinfo%,Transfer,Fast Sort,Create,Status,Printer,Quit" !��t$:m_format%=�crmenu(t$) !��"#Format,Link,Close" "9t_impulse%=�workspace(200):�t$:m_impulse%=�crmenu(t$) " �"#Command,$t_impulse%(199)" "�t$:m_macro%=�crmenu(t$) "$1�"#Macro,Browse Mode,Edit Mode#,Update Cards" ".�t$:m_macro1%=�crmenu(t$) "89�"#Macro,Browse Mode,Edit Mode#,Clear,Export>w_save%" "B�t$:m_default%=�crmenu(t$) "L�"#Default,Show,Use" "V�t$:m_file%=�crmenu(t$) "`-�"#File,Search,Sort,Compact,Link,Impulse" "j�t$:m_wind%=�crmenu(t$) "t?�"#Window,Subset,Report,Field,Index,Notepad,Macro#,Tidy Up" "~�t$:m_card1%=�crmenu(t$) "�A�"#Card,Delete,Remove,Size,Export>w_save%,Impulse>m_impulse%" "��t$:m_card%=�crmenu(t$) "�x�"#Card,Tools>w_pinfo%,Format>m_format%,Macro>m_macro%,Default>m_default%,Card>m_card1%,File>m_file%,Window>m_wind%" "�2t_subd%=�workspace(26):�t$:m_subd%=�crmenu(t$) "� �"#Description,$t_subd%(25)" "��t$:m_nums%=�crmenu(t$) "�"�"#Numeric,Create,Edit,Delete" "��t$:m_subs%=�crmenu(t$) "�>�"#Subsets,Fill,Clear,Delete,Name>m_subd%,Numeric>m_nums%" "��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$) #(r�"#Statusmenu..,Align Windows,Read Workspace,Write Workspace,Modernise,Update Media,Password,Extended Charset" #26t_iexp%=�tia(tw_expr%,17):�t$:m_index%=�crmenu(t$) #<A�"#Index.......,Ascending,Descending,No Index#,$t_iexp%(255)" #F�t$:m_mode%=�crmenu(t$) #PE�"#Find Mode,Exact,Descending,Fuzzy,Nearest,Sequential,Character" #Z� #d #n��front(h%,X%,Y%) #x �getw(h%) #��X%>=0x1%+=X%-x0%:x0%=X% #��Y%>=0y1%+=Y%-y0%:y0%=Y% #�*�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:�openpane #�:�wimpopen #�� $� $ Ȏoh%� $:�wimpopen $"� $,� $6e�oh%=dialogue%�shadows%:�getw(oh%):�open(w_shadow%,x0%+ss%,y0%-ss%,x1%+ss%,y1%-ss%,0,0,dialogue%) $@open%=O%:�f%>=0:�sdfile(f%) $J� $T $^��wimpopen $h5!q%=oh%:q%!4=ox0%:q%!8=oy0%:q%!12=ox1%:q%!16=oy1% $r>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%) %� %& %0��closew(!q%) %:�I%,f%:f%=file% %D�wtof(!q%) %N�file%>=0� %XȎwind%� %b,�0:�showbranch:�:��closeok%:�closeok:� %l�closefile(file%):�nodial:� %v6�3:�file%=edfile%:�edrep%:�endedit:!q%=w%(file%,3) %�� %�� %��!q%=dialogue%:�tidydial %�ș"Wimp_CloseWindow",,q% %�!�nodial:�wtof(!q%):�file%>=0� %�Ȏwind%� %�'�2,3,4,5,6,7:�delw(w%(file%,wind%)) %�� %�� %� Ȏ!q%� %��w_stop%:stopfile%=-1 %��w_expr%:�delw(w_expr%) %��w_nums%:�delw(w_nums%) &�w_sort%:�delw(w_sort%) &�w_open%:�delw(w_open%) &�w_finf%:�delw(w_finf%) & �w_status%:�delw(w_status%) &*�w_rlink%:�delw(w_rlink%) &4�w_srset%:�delw(w_srset%) &>�w_label%:�delw(w_label%) &H�w_line%:�delw(w_line%) &R�w_mess%:�delw(w_mess%) &\�w_passw%:�delw(w_passw%) &f�w_word%:�delw(w_word%) &p�w_pdrive%:�delw(w_pdrive%) &z�w_rset1%:�delw(w_rset1%) &��w_rset2%:�delw(w_rset2%) &��w_rset3%:�delw(w_rset3%) &��w_col%:�delw(w_col%) &��w_csize%:�delw(w_csize%) &�� &�� &�� &� &���tidydial:�restorect &�Ddialreason%=-1:dialogue%=-1:�closew(w_shadow%):exi0%=-1:exi1%=-1 &�dialfile%=-1:� &� &���restorect '�:��:��:� '(ș "Wimp_GetCaretPosition",,workbuf% 'p�!workbuf%=dialogue%ș "Wimp_SetCaretPosition",!dialct%,dialct%!4,dialct%!8,dialct%!12,dialct%!16,dialct%!20 '$� '. '8;��delw(� T%):!q%=T%:ș"Wimp_DeleteWindow",,q%:T%=-1E9:� 'B 'L*ݤia(h%,i%):�geti(h%,i%):�chkii:=q%!28 'V*ݤva(h%,i%):�geti(h%,i%):�chkii:=q%!32 '`*ݤil(h%,i%):�geti(h%,i%):�chkii:=q%!36 'j 't1ݤtia(T%,i%):�q%:q%=T%+32*i%+88:�chkii:=q%!20 '~ '�C��chkii:�(q%!24�&100)=0�1,"Icon not indirected "+�!q%+" "+�q%!4 '�� '� '�<��geti(h%,i%):!q%=h%:q%!4=i%:ș"Wimp_GetIconState",,q%:� '� '�.ݤta(h%):!q%=h%:ș"Wimp_GetWindowInfo",,q% '�,�(q%!60�&100)=0�1,"Title not indirected" '� =q%!76 '� '���stop(r%,T$,U$,T%) '�dialreason%=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% (� (( (2��dialogue(h%) (<�X%,Y%:X%=file%:�nodial (F'ș "Wimp_GetCaretPosition",,dialct% (P:dialfile%=X%:�nomenu:�readpointer:X%=mx%-200:Y%=my%-85 (Z �X%<0X%=0 (d�Y%<96Y%=96 (ndialogue%=h% (x�front(h%,X%,Y%) (��setct(h%,-1,-1) (��h%=w_impulse%� (��setct(h%,9,�$�ia(h%,9)) (�� (���pRc:� (�;�readh(h%):�h%=dialogue%:�X%:�setct(h%,X%,�$�ia(h%,X%)) (��h%<>-1:�:�X%:�X%<-1:h%=0 (��h%=dialogue%�h%<0 (�� (�� (� (�!��readpointer:�q%:q%=workbuf% (�ș"Wimp_GetPointerInfo",,q% )1mx%=!q%:my%=q%!4:mb%=q%!8:mh%=q%!12:mi%=q%!16 )� ) )"ݤdialogue:�file% ),6�dialogue%>=0�mh%<>dialogue%�mh%<>w_shadow%�nodial )6=� )@ )J$��mouse(mx%,my%,mb%,mh%,mi%,mo%) )T�dragreason%>=0�mb%>255:� )^7�wtof(mh%):�file%>=0�wind%=6�(mb%=1�mb%=4)�mi%<19:� )h�mb%<16:�dialogue:� )r3w_info%=w_pinfo%:�mb%=7:mb%=2:w_info%=w_pinfo2% )| Ȏmb%� )��2:�menu )��1,4:�select )��16,64:�startdrag )�� )�� )� )�6��seti(h%,i%,T$):T$=�T$,�il(h%,i%)):$�ia(h%,i%)=T$ )�<�iconupd(h%,i%):�getct:�!q%=h%�q%!4=i%:�setct(h%,i%,�T$) )�� )� )�'��iset(h%,i%,B%,E%):�q%:q%=workbuf% )�?!q%=h%:q%!4=i%:q%!12=B%:q%!8=E%:ș"Wimp_SetIconState",,q%:� )� *'��iconupd(h%,i%):�iset(h%,i%,0,0):� * *��force(h%) *& Ȏh%� *0.ș"Wimp_ForceRedraw",h%,-1E9,-1E9,1E9,1E9 *:� *D� *N *X��readblock(p%) *b7x0%=!p%:y0%=p%!4:x1%=p%!8:y1%=p%!12:� physical area *lFscx%=p%!16:scy%=p%!20:bhandle%=p%!24:� scroll offsets, stack depth *vJbx%=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% *��readblock(q%+4) *�� *� *���select *��wtof(mh%):�file%>=0� *�Ȏwind%� + �0:�mcard + �1:�mpane + �2:�msubs + �3:�mrep +*�4:�mflist +4�5:�milist +>� +H� +R�numi(mh%,mi%,mb%) +\3�mh%=dialogue%:�dialfile%>=0:�sdfile(dialfile%) +f Ȏmh%� +p*�-2:�mb%=1��-1��-2:�oscli(""):��status +z�w_open%:�mopen +��w_stop%:�mstop +��w_sort%:�msort +��w_save%:�msave +��w_expr%:�mexpr +��w_nums%:�mnums +��w_finf%:�mfinf +��w_status%:�mstatus +��w_rlink%:�mrlink +��w_srset%:�msrset +��w_label%:�mlabel +��w_line%:�mline +�$�w_mess%:�mi%=6:�closew(w_mess%) +��w_passw%:�mpassw ,�w_word%:�mword ,�w_pdrive%:�mpdrive ,�w_rset1%:�mrset1 ,$�w_rset2%:�mrset2 ,.�w_rset3%:�mrset3 ,8�w_col%:�mcol ,B�w_csize%:�mcsize ,L�w_impulse%:�mimpulse ,V� ,`� ,j� ,t ,~��mcard ,�%menufield%=�mousef:�menufield%>0� ,��mb%=1:�finfo(�):��fedit ,�� ,�� ,� ,�-��mflist:�Y%:Y%=my%:�yconv(Y%,�v_(7),mh%) ,�.menufield%=Y%:�mb%=1:�finfo(�):��findfield ,�� ,� ,�0��milist:�Y%:Y%=my%:�yconv(Y%,�nindices,mh%) ,�)�Y%>0:笤deadfile(-1):�selindex(Y%,0) ,�� - - ��mpane - Ȏmi%� -�0:�bof -(�1:�back -2 �2:�pause -<�3:�fwd -F�4:�eof -P �5:�ffind -Z�6:�nextmatch -d�12:�gauge -n�14:�cardnum -x�15:�fback -� �16:�ffwd -��17:�add -�*�18:�mb%=4�emacro:��s%(file%)=0:�macro -� �19:�mb%=1:�selsub(0):��subs -�4�20:�mb%=1���deadfile(-1):�selindex(0,0):��index -��21:�filter -� �22:�card -�� -�� -� -���msubs -�#�deadfile(%11111111111111110)� -�%�T%:T%=�itos:�T%>=0:�selsub(T%):� .� . . ��mrep ."Ȏr%(file%)� .,�0,1,2:�mrep1 .6 �3:�mrep3 .@ �5:�mrep5 .J�:� .T .^��mrep1 .h+�file%<>edfile%��edrep%�deadfile(-1):� .r �X%,Y%,T%,h%:�getw(mh%):h%=1 .|+�r%(file%)=1:T%=2:��r%(file%)=0:h%=�rht .�:Y%=(by%-my%-margin%-T%*linegap%)�(linegap%*h%):�Y%<0:� .�Y%+=1:�Y%>�v_(17)� .�șswi%,grec_%,Y%�N% .��validrec1:�r%(file%)<>1:� .��f%(file%)>0�err(73) .�4�getw(mh%):X%=(mx%-bx%-margin%-11*16)�16:�X%<1:� .�$�X%<=��srep(1)�edrep(X%,�v_(15)) .�� .� .���mrep3:�deadfile(-1):� .�0�Y%:�getw(mh%):Y%=(by%-my%-margin%)�linegap% .�1�Y%<0Y%=0��Y%>ll%(file%,3)-1Y%=ll%(file%,3)-1 .��Y%>15� />w_line%=�crwind(tw_line%):�unselall(w_line%):menufield%=Y% /9�seli(w_line%,�justl(Y%)):�seli(w_line%,�fontl(Y%)+5) /�spcl(Y%):�seli(w_line%,9) /& �uppl(Y%):�seli(w_line%,10) /0 �fixl(Y%):�seli(w_line%,11) /:6$�ta(w_line%)="Line "+�(Y%+1):�dialogue(w_line%):� /D /N��mrep5:�deadfile(-1):� /X6�X%,Y%,I%:�getw(mh%):Y%=(by%-my%-margin%)�linegap% /b�Y%<4�rset51:� /l�Y%>8�Y%<12�rset52:� /v�Y%>12�rset53:� /�"�mousecol:�column%<0�addcolumn /��edcol:� /� /���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)) /��3:�compact:� /��4:�fillsub(�) /��5:�fillsub(�) 0�6:�CLOSE:�quit(�) 0�7:�endsearch 0?�8:șswi%,namewrite_%,"",0,menusub%-256�G%:�makesubs(file%) 0 �9:�endfill 0*�10:�delcard 04�11:�startact(5) 0>�12:�startact(6) 0H�13:�endcsub 0R�14:�loadnotes 0\�15:�delsub 0f�16:�enddsub 0p�17:�clearnpad 0z�18:�clearmacro 0��19:�loadmacro 0��20:stopboxes%=� 0��21:�copycard1 0��22:�updcards 0��23:�endact 0��24:�endact 0��25:�endact 0��26:�asccard 0��27:șswi%,setpass_%,"" 0��28:�loadsetup 0�&�29:p$(file%,0)="":�makerep(file%) 0�&�30:ll%(file%,0)=0:�makerep(file%) 0�%�31:wo%(file%)=-1:�makerep(file%) 1.�32:șswi%,sd21_%,tx0%,ty0%,menufield%,sd$ 1%�forcecard:�r%(file%)=0:�forcerep 1�33:�r_clear:�forcerep 1$�34:�delcol(menucol%) 1.�35:�inscol(menucol%) 18+�36:�"*settype "+file$+" "+�~menufield% 1B4�menufield%=ft_data%:�openfile(file$):�:��err(1) 1L�37:�importasc 1V�38:�picpath 1`�39:�CLOSE:�create 1j%�40:�i_merging%<100i_merging%=100 1t� 1~� 1��T%=1:�CLOSE:�quit(�) 1�� 1��closew(w_stop%) 1�� 1� 1���msave 1��mi%<>0� 1�0�T$:T$=$�ia(w_save%,2):�T$=�leaf(T$):�err(5) 1�1savetype%=savet%:file$=T$:task%=-1:�savedata1 1�� 1� 1���msort:�I% 2 �mi%<>6�mi%<>7:� 2 �mi%=7�nodial:� 2/�wchi(w_sort%):o%(file%,0)=0:I%=q%:�:Ȏ!I%� 2 �3:o%(file%,0)=o%(file%,0)�1 2( �5:o%(file%,0)=o%(file%,0)�2 22�:I%+=4:�I%!-4<0 2<7o$(file%)=$�ia(w_sort%,2):ox$(file%)=�x3(o$(file%)) 2F�startsort:�nodial:� 2P 2Z��startsort:�v_(17)<2� 2d%�nofilt:�selsub(0):�selindex(0,0) 2n'o%(file%,5)=�v_(17)�2:o%(file%,4)=0 2x�startact(9):� 2� 2���swaprec(A%,B%) 2�șswi%,sd32_%,A%,B% 2�� 2� 2�#ݤso(I%):�U%:�:��:��:�err(34) 2�șswi%,grec_%,I%�N% 2�3�rlink(�):=�ev4(ox$(file%),�,(o%(file%,0)�2)=2) 2� 2���mnums:�mi%<>4�mi%<>5:� 2��T%,B%,T$:�mi%=5� 2�&B%=�$�ia(w_nums%,3):�B%=0:�err(14) 2�%T%=0:ȕ2^T%<=B%:T%+=1:�:B%=2^T%-1 3=T$=�up(�s($�ia(w_nums%,2))):�T$<2��T$>90��T$<65:�err(13) 3Ȏdialreason%� 3�0 3"T%=�:� 3,��:T%=� 36"�T%:șswi%,nameread_%,T$�G%:hh 3@��:�T%:�err(15) 3J#T%=0:ȕ�subname(T%)<>"":T%+=1:� 3T"șswi%,namewrite_%,T$,B%,-1�G% 3^�1 3h�submax(menusub%-256)<>B%� 3r,șswi%,namewrite_%,T$,B%,menusub%-156�G% 3|� 3�!șswi%,sd53_%,menusub%-256�G% 3�,șswi%,namewrite_%,T$,G%,menusub%-256�G% 3�� 3�� 3��makesubs(file%):�showsub 3�� 3� �nodial:� 3� 3�#��mopen:�mi%=11�closew(w_open%) 3� �mi%<>12� 3��I%,m%,d%,r%,p$ 3�.p$=$�ia(w_open%,14):�wchi(w_open%):I%=q%:� 3��!I%=0:d%=� 4�!I%>0�!I%<9:m%=!I%-1 4�!I%=16:r%=� 4:I%+=4:�I%!-4<0:file$=$�ia(w_open%,13):�closew(w_open%) 4&#�openfile1(file$,m%,d%,p$,r%):� 40 4:��mcsize:�w%,h%,I% 4D Ȏmi%� 4N�65:�nodial 4X�64:�sdfile(dialfile%) 4bw%=�$�ia(w_csize%,61) 4lh%=�$�ia(w_csize%,57) 4v�I%=1�2 4�șswi%,width_%,w% 4�șswi%,height_%,h% 4�� 4��fext:�forcecard:�nodial 4��:� 4� 4���mexpr 4��A%,T$,c%,s%,u%,I%,Q%,B% 4�+�unseli(w_expr%,29):�unseli(w_expr%,24) 4�<A%=�ia(w_expr%,17):�sdfile(dialfile%):�qbscan($A%,Q%,B%) 4� Ȏmi%� 4��2,3,4,5,6,7,8,9 4�>�$A%>""��Q%$sd%=�"+-*/=<><()",mi%-1,1):�$sd%<>�$A%)T$=$sd% 5�mi%=7:�T$>"":T$+=">" 5�seti(w_expr%,17,$A%+T$) 5 �10,11 5 N�(($A%>""�B%>0)�mi%=10)��Q%:$sd%=�"()",mi%-9,1):�seti(w_expr%,17,$A%+$sd%) 5* �12,13 54T$=$A%:�$A%>""��Q%� 5>$sd%=�$A%):șswi%,upper_% 5H7�($sd%>="A"�$sd%<="Z")�($sd%>="0"�$sd%<="9")T$+=" " 5R�mi%=12T$+="AND"�T$+="OR" 5\� 5f�seti(w_expr%,17,T$) 5pR�14:�$A%>""��Q%T$=$A%+"=""**""":�seti(w_expr%,17,T$):�setct(w_expr%,17,�$A%-2) 5zQ�15:�$A%>""��Q%T$=$A%+"~=""""":�seti(w_expr%,17,T$):�setct(w_expr%,17,�$A%-1) 5��20,21:�subs 5��22:�nodial 5��26:�nofilt:�nodial 5�B�24:�$A%=""�seti(w_expr%,17,ex$):�ex$=$A%:�seti(w_expr%,17,"") 5�4�dialreason%=0:�seli(w_expr%,0):�seli(w_expr%,1) 5�#�29:�seti(w_expr%,17,f$(file%)) 5��23 5��wchi(w_expr%):I%=q%:� 5� Ȏ!I%� 5��1:s%=� 5��0:u%=� 5��28:c%=� 5�� 6I%+=4:�I%!-4=-1 6�conv($A%):�u%:�upplit($A%) 6�seti(w_expr%,17,$A%) 6$Ȏdialreason%� 6.�0:�setfilt 68�1:�search 6B �2:�rset2 6L� 6V�nodial 6`� 6j�iconupd(w_expr%,17) 6t� 6~ 6���mfinf 6� Ȏmi%� 6��17:�closew(w_finf%) 6�)�7:�geti(w_finf%,7):�(q%!24)�(1<<21)� 6�+�geti(w_finf%,12):�((q%!24)�(1<<21))=0� 6�)�unseli(w_finf%,10):�seli(w_finf%,11) 6�� 6�� 6� �13,14,15 6�=�unseli(w_finf%,10):�unseli(w_finf%,11):�seli(w_finf%,12) 6��19 6��T$,T%,B%,L%,K%,I% 7 %�w%(file%,4)>0�force(w%(file%,4)) 7 BT$=$�ia(w_finf%,5):T%=�$�ia(w_finf%,2):�T%<1T%=1��T%>255T%=255 7$B%=��up(T$):�B%<65�B%>90�err(16) 70L%=�$�ia(w_finf%,20):�L%<1L%=1��L%>255L%=255 7(,B%=�$�ia(w_finf%,13):�B%<0B%=0��B%>6B%=6 72K%=�:�wchi(w_finf%):I%=q%:� 7< Ȏ!I%� 7F�6:K%=� 7P�7:B%=B%�8 7Z�8:B%=B%�128 7d�9:B%=B%�64 7n�10:B%=B%�7 7x�11:B%=B%��7 7�� 7�I%+=4:�I%!-4<0 7�%șswi%,sd18_%,B%,4,menufield%,sd$ 7�#șswi%,sd20_%,T$,menufield%,sd$ 7��sdfile(file%) 7��dialreason%� 7�șswi%,makekey_%,menufield% 7�"șswi%,flength_%,L%,menufield% 7�"șswi%,fnumber_%,T%,menufield% 7�menufield%=T% 7�� 7�7T%=file%:�closew(w_finf%):�sdfile(T%):�validatelink 7�!�flg(f_pics%,�isfield("PIC")) 8� 8� 8 8"��mrlink 8, Ȏmi%� 86�6:�l%(file%)>0:�unlink 8@�7 8J�8 8T:�T$,I%,T%:T%=�filenum($�ia(w_rlink%,1)):�T%<0:�err(38) 8^@I%=file%:�sdfile(T%):�deadfile1(%11111111101011110)�err(39) 8h/�sdfile(I%):lk$(file%)=�s($�ia(w_rlink%,3)) 8rHI%=�lk$(file%):�I%>32�I%<>64�I%<>35�I%<>124lk$(file%)="@"+lk$(file%) 8|El$(file%)=$�ia(w_rlink%,5):lx$(file%)=�x4(l$(file%)):�chkloop(T%) 8�:�selsub(0):�nofilt:l%(file%)=T%+1:links%+=1:�forcecard 8�#�sdfile(T%):�validrec:�forcerep 8�:� 8�� 8��closew(w_rlink%):� 8� 8�5ݤfilenum(T$):�I%,T%:T%=-1:T$=�su(T$):�I%=0�maxf% 8�6�w%(I%,0)>0:�up(�ofilename(I%))=T$:T%=I%:I%=maxf% 8� �:=T% 8� 8���chkloop(T%) 8�3�T%=file%:�err(40):��l%(T%)>0�chkloop(l%(T%)-1) 8�� 9 9 ��mstatus 9�T%,I%,A%,P% 9& Ȏmi%� 90�15,16,17,18,19,20,21,22 9:-T%=�statf:�T%>=0�front(w%(T%,0),-1,-1):�� 9D�12 9N�13 9X&P%=pix%:sound%=�:shadows%=�:pix%=� 9b�wchi(w_status%):I%=q%:� 9l Ȏ!I%� 9v�24:sound%=� 9��25:shadows%=� 9��28:pix%=� 9��23:A%=� 9�� 9�I%+=4:�I%!-4<0 9�+�sound%:șswi%,opt_%,10:�șswi%,opt_%,9 9��pix%<>P%� 9�+�I%=0�maxf%:�w%(I%,0)>0�force(w%(I%,0)) 9�� 9�� 9��A%<>stopboxes%� 9�F�A%stopboxes%=�:��stop(20,rl$+"disable these","stop boxes ?",-1):� 9�� :� :� :�closew(w_status%):� : :*��msrset :4�T$,I%:�unseli(w_srset%,9) :> Ȏmi%� :H�6 :RGT$=�x5($�ia(w_srset%,3)):srx$(file%)=T$:sr$(file%)=$�ia(w_srset%,3) :\#�flg(f_stot%,�):�flg(f_srup%,�) :f#�flg(f_stit%,�):�flg(f_sdas%,�) :p"�wchi(w_srset%):I%=q%:�:Ȏ!I%� :z�0:�flg(f_srup%,�) :��1:�flg(f_stot%,�) :��7:�flg(f_stit%,�) :��8:�flg(f_sdas%,�) :��:I%+=4:�I%!-4<0:�forcerep :��nodial :��5:�nodial :�[�9:�$�ia(w_srset%,3)=""�seti(w_srset%,3,ex$):�ex$=$�ia(w_srset%,3):�seti(w_srset%,3,"") :�� :�� :� :�(��mlabel:�mi%=29:�closew(w_label%):� :��I%,A%:��DB{ :�P�mi%>27�mi%<32�I%=0�7:�A%:ll%(file%,I%)=�$�ia(w_label%,A%):�:�rext:�forcerep ; Ȏmi%� ;�31:�printone ;�30:�testlab ;$ �:�lwidth ;.$�mi%>27�mi%<32:�closew(w_label%) ;8� ;B�12,41,23,6,15,19,48,52 ;L ;V&��mline:�mi%=13:�closew(w_line%):� ;` �mi%<>12� ;j5�I%,T%,V%:T%=menufield%:�wchi(w_line%):V%=0:I%=q% ;t�:Ȏ!I%� ;~�1:V%=(V%��3)�1 ;��2:V%=(V%��3)�2 ;��6:V%=(V%��12)�(1<<2) ;��7:V%=(V%��12)�(2<<2) ;��9:V%=V%�16 ;��10:V%=V%�32 ;��11:V%=V%�64 ;�%�:I%+=4:�I%!-4<0:lf%(file%,T%)=V% ;� �forcerep:�closew(w_line%):� ;� ;�%��mpassw:�mi%=4:�closew(w_passw%) ;��mi%<>3� ;�J�T$,t$:T$=�su($�ia(w_passw%,5)):�sdfile(dialfile%):șswi%,sd63_%,T$�G% <