home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rcopy.zip / rcopy.cmd next >
OS/2 REXX Batch file  |  1996-03-06  |  41KB  |  1 lines

  1. /* "RCOPY v1.12 03/96 Dean Ammons All Rights Reserved" */;'@ECHO OFF';parse arg prms;call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs';call SysLoadFuncs;do while chars()>0;parse value SysGetKey('NOECHO') With c;end;v.='';if prms=''|prms='?' then;do;parse source . . p;p=FILESPEC('drive',p)||'\'||strip(FILESPEC('path',p),'B','\');'START /PM VIEW '||strip(p,'T','\')||'\RCOPY OPTIONS';EXIT '';end;prms=prms||value('RCOPY',,'OS2ENVIRONMENT');op=prms;v.1=DIRECTORY();v.2=left(v.1,2);v.3=SysSearchPath('PATH','RCOPY.CMD');if v.3='' then;v.3=v.1;else;v.3=FILESPEC('drive',v.3)||FILESPEC('path',v.3);h='';do until l=0;l=pos('/PGM',translate(prms));if l>0 then;do;l2=pos('/',prms,l+1);if l2=0 then;l2=length(prms)+1;h=h||substr(prms,l,l2-l);prms=left(prms,l-1)||substr(prms,l2);end;end;do while pos(' ',h)>0;h=overlay('·',h,pos(' ',h));end;prms=prms||h;if left(subword(prms,1,1),1)<>'/' then;do;v.4=translate(subword(prms,1,1));prms=subword(prms,2);v.4=P35(v.4);if pos('/',v.4)>0 then;do;prms=substr(v.4,pos('/',v.4))||prms;v.4=left(v.4,pos('/',v.4)-1);end;i=1;h='';do while subword(v.4,i,1)<>'';h2=subword(v.4,i,1);i=i+1;if left(h2,1)='@' then;h=h||P45(substr(h2,2))||' ';else;h=h||h2||' ';end;v.4=h;end;v.4=strip(v.4,'B',' ');if left(subword(prms,1,1),1)<>'/'&subword(prms,1,1)<>'' then;do;if pos('/',prms)>0 then;do;v.5=strip(translate(left(prms,pos('/',prms)-1)),'B',' ');prms=substr(prms,pos('/',prms));end;else;do;v.5=translate(subword(prms,1,1));prms=subword(prms,2);end;v.15='C';end;else;v.5=v.1;do while pos('/',prms)>0;prms=overlay(' ',prms,pos('/',prms));end;v.21='NN';v.47='NN';s_a='*****';ct.='';cs.='';cd.='';row=0;v.61='N';v.31='N';v.32='N';v.27=0;i=1;v.41=0;v.26=999;pg.0=0;v.43=0;f_splt=0;us_fn=' ';F3K='';v.39=1;v.40=1;v.54='N';v.49=0;v.52='N';v.33=0;v.34=0;v.35=0;v.37=0;v.38=512;do while subword(prms,i,1)<>'';y='Y';n='N';v.0=translate(P35(strip(subword(prms,i,1),'T',',')));if left(v.0,1)='-' then;do;y='N';n='Y';v.0=substr(v.0,2);end;i=i+1;if v.0='AD' then;v.11='D';if v.0='AF' then;v.11='F';if v.0='AP' then;v.12=y;if v.0='AN' then;v.13=y;if v.0='AS' then;v.14=y;if v.0='DEL' then;v.15='D';if v.0='DO' then;v.16='O';if v.0='AFX' then;v.17=y;if v.0='DC' then;v.18=y;if left(v.0,3)='DR:' then;v.19=substr(v.0,4);if v.0='ED' then;v.20=y;if v.0='FO'|v.0='FA' then;v.21='YY';if v.0='FO2'|v.0='FA2' then;v.21='NY';if v.0='H' then;v.22=y;if v.0='L' then;v.23=y;if v.0='LG' then;if v.24='' then;v.24=v.3||'RCOPY.LOG';else;v.24='';if left(v.0,3)='LG:' then;do;v.24=strip(substr(v.0,4),'T','\');if pos('.',v.24)=0 then;v.24=v.24||'\RCOPY.LOG';if pos(left(v.24,1),'@!')>0 then;do;if left(v.24,1)='!' then;v.103=y;v.24=substr(v.24,2);rc=SysFileDelete(v.24);end;end;if left(v.0,2)='MU' then;do;v.25=y;if substr(v.0,3,1)=':' then;do;v.26=substr(v.0,4);if v.26<2 then;v.26=2;end;end;if left(v.0,2)='PE' then;do;v.27=substr(v.0,3);if datatype(v.27,'w')<>1 then;v.27=99999;end;if v.0='RD' then;v.28=y;if v.0='RO' then;v.29=y;if v.0='SA' then;v.30=y;if v.0='SD' then;v.31=y;if v.0='SD2' then;v.32=y;if left(v.0,4)='#FP:' then;if datatype(substr(v.0,5),'w')=1 then;v.33=substr(v.0,5);if left(v.0,4)='#BC:' then;if datatype(substr(v.0,5),'w')=1 then;v.34=substr(v.0,5);if left(v.0,4)='#FC:' then;if datatype(substr(v.0,5),'w')=1 then;v.35=substr(v.0,5);if left(v.0,4)='#ND:' then;if datatype(substr(v.0,5),'w')=1 then;do;v.41=substr(v.0,5);if v.41>0 then;v.39=v.41;end;if v.0='SE' then;v.42=y;if left(v.0,3)='SF:' then;do;if datatype(substr(v.0,4),'w')=1 then;do;v.43=format(substr(v.0,4));if pos('.',v.43)>0 then;v.43=left(v.43,pos('.',v.43)-1);if v.43='' then;v.43=32;v.43=v.43*1024;end;end;if left(v.0,3)='ST:'&datatype(substr(v.0,4) ,'w')=1 then;v.38=v.38+substr(v.0,4);if v.0='A' then;v.45=n;if v.0='B' then;v.46=y;if v.0='DF' then;v.47='YY';if v.0='DF2' then;v.47='NY';if left(v.0,3)='DD:' then;if datatype(substr(v.0,4),'w')=1 then;v.49=substr(v.0,4);if v.0='BO' then;v.50=y;if v.0='N' then;v.51=y;if v.0='ND' then;v.52=y;if v.0='NS' then;v.53=n;if v.0='NT' then;v.54=substr('YN',pos(v.54,'NY'),1);if left(v.0,3)='PGM'&pos(':',v.0)>0 then;do;F3K=61;if substr(v.0,4,1)<>':' then;do;v.102=substr(v.0,4);v.102=left(v.102,pos(':',v.102)-1);end;if datatype(v.102,'w')<>1|substr(v.0,4,1)=':' then;v.102=100;l=pg.0+1;pg.0=l;h=P35(subword(prms,i-1,1));pg.l=substr(h,pos(':',h)+1);if left(pg.l,1)='-' then;do;v.55='PGM.CMD';pg.l=substr(pg.l,2);rc=SysFileDelete(v.55);end;do while pos('·',pg.l)>0;pg.l=overlay(' ',pg.l,pos('·',pg.l));end;do while pos(']',pg.l)>0;pg.l=overlay('/',pg.l,pos(']',pg.l));end;do while pos(')',pg.l)>0;pg.l=overlay('>',pg.l,pos(')',pg.l));end;do while pos('(',pg.l)>0;pg.l=overlay('<',pg.l,pos('(',pg.l));end;do while pos('!',pg.l)>0;pg.l=overlay('|',pg.l,pos('!',pg.l));end;pg.l=v.102||' '||translate(subword(pg.l,1,1))||' '||subword(pg.l,2);end;if left(v.0,3)='OF:' then;do;h=substr(v.0,4);if left(h,1)='@' then;h=P45(substr(h,2) 'Y');v.36=v.36||' '||h;end;if left(v.0,3)='OD:' then;do;h=substr(v.0,4);if left(h,1)='@' then;h=P45(substr(h,2));v.56=v.56||' '||h;end;if v.0='NC' then;v.104=y;if v.0='P' then;v.57=y;if v.0='R' then;v.58=y;if v.0='RE' then;v.59=y;if v.0='S' then;v.60='S';if v.0='T' then;v.61=y;if v.0='U' then;v.62=y;if v.0='O' then;v.106=y;if v.0='US' then;v.9=y;if v.0='V' then;v.63=y;if v.0='WA' then;v.64=y;if v.0='WY' then;v.65=y;if v.0='M' then;v.15='M';dh='';h='';if left(v.0,2)='D:' then;do;v.0=substr(v.0,3);if pos(left(v.0,1),'=()')>0&pos(substr(v.0,2,1),'=()')>0 then;do;v.16='O';h=left(v.0,1);v.0=substr(v.0,2);end;else;if pos(left(v.0,1),'=()')=0 then;v.0='='||v.0;d=substr(v.0,2);if datatype(d,'w')<>1 then;do;Call SysFileTree strip(d,'L','@'),'cf.', 'F';parse upper var cf.1 d .;if substr(d,2,1)='/' then;d='0'||d;d=right(d,2)||left(d,2)||substr(d,4,2);end;if datatype(d,'w')=1 then;do;dha=left(v.0,1);if dha=')' then;dh=P18('-'||d);else;dh=P18(d);if cd.1='' then;do;cd.1=dh;cda.1=dha;if h<>'' then;do;cda.2=h;if h=')' then;cd.2=P18('-'||d);else;cd.2=P18(d);end;end;else;if cd.2='' then;do;cd.2=dh;cda.2=dha;end;end;end;th='';if left(v.0,2)='T:' then;do;v.0=substr(v.0,3);if pos(left(v.0,1),'=()')>0&pos(substr(v.0,2,1),'=()')>0 then;do;v.16='O';h=left(v.0,1);v.0=substr(v.0,2);end;else;if pos(left(v.0,1),'=()')=0 then;v.0='='||v.0;th=strip(substr(v.0,2),'L','0');if datatype(th,'w')<>1&pos(':',th)=0 then;do;Call SysFileTree strip(th,'L','@'),'cf.', 'F';parse upper var cf.1 . th .;end;if pos(':',th)=0 then;do;l=4-length(th);if l>0 then;th=center('',l,'0')||th;th=left(th,2)||':'||right(th,2);end;hr=left(th,pos(':',th)-1);cm=substr(th,pos(':',th)+1);cm=strip(cm,'T','P');cm=strip(cm,'T','A');if right(th,1)='P'&hr<12 then;hr=hr+12;th=hr||cm;tha=left(v.0,1);if datatype(th,'w')=1 then;if ct.1='' then;do;ct.1=th;cta.1=tha;if h<>'' then;do;ct.2=th;cta.2=h;end;end;else;if ct.2='' then;do;ct.2=th;cta.2=tha;end;end;sh='';if left(v.0,3)='SZ:' then;do;v.0=substr(v.0,4);if pos(left(v.0,1),'=()')>0&pos(substr(v.0,2,1),'=()')>0 then;do;v.16='O';h=left(v.0,1);v.0=substr(v.0,2);end;else;if pos(left(v.0,1),'=()')=0 then;v.0='='||v.0;sh=substr(v.0,2);sha=left(v.0,1);if datatype(sh,'w')<>1 then;do;Call SysFileTree strip(sh,'L','@'),'cf.', 'F';parse upper var cf.1 . . sh .;end;if datatype(sh,'w')=1 then;if cs.1='' then;do;cs.1=sh;csa.1=sha;if h<>'' then;do;cs.2=sh;csa.2=h;end;end;else;if cs.2='' then;do;cs.2=sh;csa.2=sha;end;end;if left(v.0,3)='IP:' then;v.66=v.66||substr(v.0,4)||' ';if left(v.0,4)='IP-:' then;v.67=v.67||substr(v.0,5)||' ';end;v.101=1;e_ok=1;v.68=v.33-v.35;if pos('\',v.5)=0&pos(':',v.5)=0 then;v.11='F';if pos('\',v.5)=0&pos(':',v.5)=0 then;v.5=strip(v.1,'T','\')||'\'||v.5;if left(v.5,1)='\' then;v.5=v.2||v.5;if v.64='Y' then;call P29 left(v.5,2);if v.14='Y' then;v.13='N';if (v.11=''&v.18='Y')|pos('*',v.4)>0|pos('?',v.4)>0 then;v.11='D';if v.52='Y' then;do;v.32='Y';v.54='Y';end;if v.32='Y' then;v.31='Y';if v.63='Y' then;v.63=' /V';else;v.63='';if pos(left(v.5,1),'AB')=0 then;v.21='NN';if right(v.21,1)='Y' then;v.47='NN';if v.50='Y' then;v.58='Y';if v.24<>'' then;do;rc=lineout(v.24,' ',);call lineout v.24, '****  RCOPY Started at '||left(time('N'),5)||' '||space(left(date('N'),6),0)||right(date('N'),2);call lineout v.24, '  ';call lineout v.24, '  RCOPY '||op;call lineout v.24, '  ';end;if v.61='Y' then;call P39('N' v.52 center(' TEST RUN ONLY -- PROCESSING WILL BE SIMULATED ',78,'*'));if v.41=0 then;do;call P39('N' v.52 '┌────────────────────┐');call P39('N' v.52 '│RCOPY(c) v1.12 03/96│');call P39('N' v.52 '└────────────────────┘');end;if left(v.21,1)='Y' then;call P26;rc=P28(left(v.5,2));if right(v.5,1)=':' then;do;v.5=DIRECTORY(v.5);call DIRECTORY(v.1);end;ed=0;if pos(right(v.5,1),'\.')=0 then;call P13;else;v.70='Y';v.6=FILESPEC('drive',v.5)||FILESPEC('path',v.5);v.7=FILESPEC('name',v.5);v.10=v.6;if v.7='NUL'&v.15='M' then;v.15='D';if v.6<>'' then;v.8=v.6;if (pg.0>0&v.15='')|v.23='Y' then;v.15='R';else;if v.9='Y'|v.43>0 then;do;v.48=0;if v.9='Y' then;v.43=0;v.15h=v.15;v.15='S';end;if v.15='' then;v.15='C';if pg.0=0 then;v.104='N';if v.15='C' then;v.59='N';if pos('\',substr(v.5,4))=0 then;dir_srch_criteria=strip(v.5,'T','\')||'\';else;do;l=length(v.5);do while l>0;if substr(v.5,l,1)='\' then;do;dir_srch_criteria=left(v.5,l);leave;end;l=l-1;end;end;v.91=v.41;v.73=v.33;v.92='';v.81='';do until v.25<>'Y';v.93='';ts=1;sc=0;v.71='';nd='';fspcs.='.';do while subword(v.4,ts,1)<>'';v.94=v.19;v.72=subword(v.4,ts,1);if pos('..',v.72)>0 then;do;Call SysFileTree v.72,'cf.', 'FO';if filespec('drive',cf.1)<>''&filespec('path',cf.1)<>'' then;v.72=filespec('drive',cf.1)||filespec('path',cf.1)||filespec('name',v.72);else;do;ts=ts+1;iterate;end;end;if pos(':',v.72)=0 then;v.72=left(DIRECTORY(),2)||v.72;if substr(v.72,2,1)=':'&pos('\',v.72)=0 then;v.72=strip(DIRECTORY(),'T','\')||'\'||substr(v.72,3);if v.94='' then;v.94=left(v.72,1);if v.60='S' then;h=' (Sub-Directories Included)';else;h='';if v.15='S'&v.43=0 then;do;h='UNSPLIT';l=P44(v.72);if substr(v.72,l,1)<>'.'|pos('*',v.72)>0|pos('?',v.72)>0 then;v.72=v.72||' - Invalid File Spec for UNSPLIT';else;do;ds=P28(left(v.72,2));Call SysFileTree left(v.72,l)||'*', 'cf.','FO';db.='';db.0=0;do ii=1 to cf.0;ext=right(cf.ii,3);if datatype(ext,'w')<>1|pos('.',ext)>0 then;cf.ii='.';else;do;ext=strip(ext,'L','0');db.ext=cf.ii;cf.ii=ext;if ext>db.0 then;db.0=ext;end;end;do ii=1 to cf.0;if cf.ii='.' then;iterate;v.48=v.48+1;if v.48<>cf.ii then;do;ii=cf.ii;v.72=db.ii||' - UNSPLIT File Out of Sequence';leave;end;end;end;if pos(' ',v.72)>0 then;do;call P39('N' v.52 v.72);ts=ts+1;v.40=v.40-1;v.39=V.40;v.48=v.48-1;v.101=v.101-1;leave;end;s_ext.0=ts;s_ext.ts=substr(v.72,l+1);v.72=left(v.72,l)||'*';end;do s=1 to length(v.94);v.72=substr(v.94,s,1)||substr(v.72,2);if v.60='S'|pos('*',v.72)>0&h<>'UNSPLIT' then;do;call P39('Y' v.31 'Searching  ==> '||v.72||h);if v.31='N' then;do;sc=sc+1;call P41;end;end;rc=P28(left(v.72,2));Call SysFileTree v.72, 'fspcs.'||ts||'.', 'F'||v.60, s_a;if v.59='Y' then;do l = length(v.72) to 1 by -1;if substr(v.72,l,1)='\' then;do;ed=ed+1;sd.ed=left(v.72,l-1);leave;end;end;v.73=v.73+fspcs.ts.0;ts=ts+1;end;end;ts=ts-1;if ts=0 then;do;e_ok=0;signal P36;end;call P1;if v.59='Y' then;call P15;if v.15='S'&v.97<>'' then;do;if v.43>0 then;call P21;else;call P22;v.97='';end;if v.101=v.26 then;v.25='N';if v.25='Y' then;do;say center('',78,' ');h='Press <ENTER> after Inserting Diskette ';if v.26<>999 then;h=h||v.101+1||' of '||v.26;else;h=h||'#'||v.101+1;h=h||' or <ESC> to Quit';say h;say;call P41;if v.53<>'N' then;beep(524,250);do until subword(ik,1,1)='27'| subword(ik,1,1)='13';ik=P40();end;call P42('3');if subword(ik,1,1)='27' then;v.25='N';else;do;v.101=v.101+1;v.20='N';end;end;end;e_ok=0;signal P36;P1:;if sc>0 then;do;if sc>row then;call SysCls;else;call P42(sc);sc=0;end;if v.47='YY' then;call P25;si=0;fsi=1;nx_dsk='N';v.87='Y';v.1_fls='';do forever;if chars()>0 then;call P38;si=si+1;if ((v.35+v.68)=v.73) then;leave;else;if si>fspcs.fsi.0 then;do;si=1;if fsi<=ts then;do until fspcs.fsi.0>0|fsi>ts;fsi=fsi+1;end;if fsi>ts then;do;if v.1_fls<>'' then;call P8;nx_dsk='Y';fsi=1;end;end;if fspcs.fsi.si='.'| fspcs.fsi=0 then;iterate;fspcs.fsi.si=space(fspcs.fsi.si);parse upper var fspcs.fsi.si v.74 v.75 v.76 v.77 v.78;if right(v.78,3)=' SF' then;do;v.73=v.73-1;fspcs.fsi.si='.';iterate;end;v.80=FILESPEC('drive',v.78)||strip(FILESPEC('path',v.78),'T','\');if right(v.80,1)=':' then;v.80=v.80||'\';v.82=v.80;v.79=FILESPEC('name',v.78);v.83=0;v.84=v.79;l=12-length(v.84);if l>0 then;v.84=v.84||center('',l,' ');f=v.76;l=10-length(f);if l>0 then;f=center('',l,' ')||f;if substr(v.74,2,1)='/' then;v.74=' '||v.74;if substr(v.75,2,1)=':' then;v.75=' '||v.75;v.84=v.84||' '||f||' '||v.74||' '||v.75;if v.81<>v.80&v.1_fls<>'' then;do;call P8;si=si-1;iterate;end;if v.15='S'&v.43=0 then;if pos('.',v.79)=0 | datatype(right(v.79,3),'w')<>1 then;do;call P10(fsi si 'Not Split File');iterate;end;if v.81<>v.80 then;do;v.85=P47(v.80);call P9 'N';end;v.86='Y';if v.85='Y' then;v.86='Dir Omitted';else;if v.22<>'Y' & (substr(v.77,3,1)='H' | substr(v.77,5,1)='S') then;v.86='System/Hidden';else;if v.45='N'&substr(v.77,1,1)<>'A' then;v.86='Not Updated';else;do;if v.86='Y'&v.66<>'' then;call P3;if v.86='Y'&v.67<>'' then;call P4;if v.86='Y'&cd.1<>'' then;call P5;if v.86='Y'&ct.1<>'' then;call P6;if v.86='Y'&cs.1<>'' then;v.86=P7('Size' v.86 v.76 csa.1 cs.1 csa.2 cs.2);if v.86='Y'&v.36<>'' then;call P2;end;if v.86='Y' then;v.1_fls=v.1_fls||fsi||' '||si||' ';else;call P10(fsi si v.86);end;return;P2:;o=1;do while subword(v.36,o,1)<>''&v.86='Y';if v.79=P14(subword(v.36,o,1)) then;v.86='File Omitted';o=o+1;end;return;P3:;o=1;do while subword(v.66,o,1)<>''&v.86='Y';h=strip(subword(v.66,o,1),'T','\')||'\'||v.79;o=o+1;Call SysFileTree h, 'cf.', 'FO';if cf.0=0 then;v.86='Not Found/IP';end;return;P4:;o=1;do while subword(v.67,o,1)<>''&v.86='Y';h=strip(subword(v.67,o,1),'T','\')||'\'||v.79;o=o+1;Call SysFileTree h, 'cf.', 'FO';if cf.0>0 then;v.86='Found/IP-';end;return;P5:;d=v.74;do while pos('/',d)>0;d=overlay(' ',d,pos('/',d));end;parse var d mm dd yy;if length(mm)=1 then;mm='0'||mm;if length(dd)=1 then;dd='0'||dd;d=yy||mm||dd;v.86=P7('Date' v.86 d cda.1 cd.1 cda.2 cd.2);return;P6:;t=translate(v.75);hr=left(t,pos(':',t)-1);cm=substr(t,pos(':',t)+1);cm=left(cm,length(cm)-1);if right(t,1)='P'&hr<12 then;hr=hr+12;t=hr||cm;v.86=P7('Time' v.86 t cta.1 ct.1 cta.2 ct.2);return;P7: PROCEDURE EXPOSE v.16;parse arg ty st d o1 p1 o2 p2;o.1=o1;o.2=o2;p.1=p1;p.2=p2;s.='Y';do i=1 to 2;if o.i='('&d>=p.i then;s.i='Not Before '||ty;if o.i=')'&d<=p.i then;s.i='Not After '||ty;if o.i='='&p.i<>d then;s.i='Not Equal '||ty;if (v.16<>'O'&s.i<>'Y')|(v.16='O'&s.i='Y') then;return s.i;end;return s.1;P8:;scntr=0;v.82='';do until subword(v.1_fls,scntr,1)='';scntr=scntr+1;if subword(v.1_fls,scntr,1)='' then;leave;sel1=subword(v.1_fls,scntr,1);scntr=scntr+1;sel2=subword(v.1_fls,scntr,1);v.87='N';v.88='N';if chars()>0 then;call P38;parse upper var fspcs.sel1.sel2 v.74 v.75 v.76 v.77 v.78;if v.82='' then;do;v.80=FILESPEC('drive',v.78)||strip(FILESPEC('path',v.78),'T','\');if right(v.80,1)=':' then;v.80=v.80||'\';v.82=v.80;if v.49<0 then;do;v.80=P43(v.80 v.49);if length(v.80)=3 then;v.80='';end;if v.18='Y' then;do;h=strip(strip(v.6,'T','\')||substr(v.80,3),'T','\')||'\';if v.7<>'' then;h=h||v.7;if v.5<>h then;do;nd='';v.5=h;v.8=FILESPEC('drive',v.5)||FILESPEC('path',v.5);if v.8<>'' then;do;if v.49>0 then;v.8=P43(v.8 v.49);end;end;if v.6<>''&v.15='S' then;v.10=FILESPEC('drive',v.5)||FILESPEC('path',v.5);end;end;v.79=FILESPEC('name',v.78);v.89=v.76+v.38;v.83=0;v.84=v.79;l=12-length(v.84);if l>0 then;v.84=v.84||center('',l,' ');f=P34(v.76);l=10-length(f);if l>0 then;f=center('',l,' ')||f;if substr(v.74,2,1)='/' then;v.74=' '||v.74;if substr(v.75,2,1)=':' then;v.75=' '||v.75;v.84=v.84||' '||f||' '||v.74||' '||v.75;if v.7<>'' then;v.95=P14(v.7);else;v.95=v.79;if nx_dsk='Y' then;do;v.90=P28(left(v.5,2));call P24;if v.87='Y' then;iterate;end;if v.92<>v.8 then;do;v.92=v.8;if v.20='Y'&v.61='N' then;'del "'||v.8||'*.*" /F/N 1>nul 2>nul';end;if pos(v.15,'DRS')=0 then;if v.78=strip(v.8,'T','\')||'\'||v.95 then;do;call P10(sel1 sel2 "Can't Copy to Itself");iterate;end;ff='N';if pos(v.15,'DRS')=0 then;do;Call SysFileTree v.8||v.95, 'cf.', 'F', s_a;if cf.0>0 then;do;cf.1=space(cf.1);parse upper var cf.1 cf_d cf_t cf_s cf_a .;ff='Y';end;end;if (v.50='Y'&ff<>'Y') then;do;call P10(sel1 sel2 'Not Both');iterate;end;if ff='Y' then;do;if v.51='Y' then;do;call P10(sel1 sel2 'Not New');iterate;end;if cf_d=v.74&cf_t=v.75&cf_s=v.76 then;do;msg1='Exact';v.88='Y';if v.42='Y' then;do;call P10(sel1 sel2 'Duplicate');iterate;end;end;else;msg1='A';if v.62='Y'|v.106='Y' then;do;Call SysFileTree v.78, 'f.', 'FT', s_a;Call SysFileTree v.8||v.95, 't.', 'FT', s_a;f.1=subword(f.1,1,1);t.1=subword(t.1,1,1);if v.62='Y' then;if left(t.1,8)>left(f.1,8) | (left(t.1,8)=left(f.1,8) & (right(t.1,5)>right(f.1,5) | (right(t.1,5)=right(f.1,5)&cf_s=v.76))) then;do;call P10(sel1 sel2 'Not Newer');iterate;end;if v.106='Y' then;if left(t.1,8)<left(f.1,8) | (left(t.1,8)=left(f.1,8) & (right(t.1,5)<right(f.1,5) | (right(t.1,5)=right(f.1,5)&cf_s=v.76))) then;do;call P10(sel1 sel2 'Not Older');iterate;end;end;msg1=msg1||' copy of '||v.95||' already exists--';msg2='Current: '||cf_d||' '||cf_t||' ('||P34(cf_s)||')     ';msg2=msg2||'Copy: '||v.74||' '||v.75||' ('||P34(v.76)||')';end;else;do;msg2=' '||v.74||' '||v.75||' ('||P34(v.76)||')';cf_s=0;cf_d='';cf_t='';end;if v.87='N' & pos(v.15,'DRS')=0 & v.83=0 & v.61='N' then;do;call P23;if v.87='Y' then;iterate;end;if v.87='N'&nd=''&pos(v.15,'DR')=0 then;do;call P30;if v.98='Y' then;nd=v.99;if v.87='Y' then;iterate;end;if p_fspec=v.80&p_fspec<>'' then;if pos('Processing ==> ',SysTextScreenRead(1,0))=0 then;do;p_fspec='';call P9 'Y';end;if v.87='N' then;if p_to_spec<>v.8|p_fspec<>v.80|v.71<>'' then;do;if pos(v.15,'DR')=0 then;do;h=strip(v.8,'T','\');if right(h,1)=':' then;h=h||'\';if v.15='S' then;do;if v.43>0 then;h='..Split To ==> '||h;else;h='UnSplit To ==> '||h;end;else;if v.15='M' then;h='...Move To ==> '||h;else;h='...Copy To ==> '||h;call P39('N' v.31 h||v.71);end;else;if v.31='Y'& v.82<>v.1 then;do;if length(v.82)<63 then;call P39('Y' v.52 'Processing ==> '||v.82||center('',63-length(v.82),' '));else;call P39('Y' v.52 'Processing ==> '||left(v.82,63));end;p_to_spec=v.8;p_fspec=v.80;v.71='';end;if (ff='Y'&(v.62='Y'|v.106='Y')) | v.83>0 | v.87='Y' | (v.30='Y'&v.57<>'Y') then;NOP;else;if ff='Y'&v.57<>'Y'&v.58<>'Y'&pos(v.15,'DRS')=0 then;do;say;say msg1;say msg2;say '<R>eplace <N>o Action <C>ontinuous Replace <Escape>?';call P41;do until pos(subword(ik,2,1),'RNC')>0 | subword(ik,1,1)='27';if v.53<>'N' then;beep(524,250);ik=P40();end;call P42('4');if subword(ik,1,1)='27' then;signal P36;if subword(ik,2,1)='N' then;do;v.68=v.68+1;fspcs.sel1.sel2='.';v.87='Y';end;if subword(ik,2,1)='C' then;v.58='Y';end;else;if v.57='Y' then;do;if pos(v.15,'DSR')>0 then;do;if pos(v.15,'SR')>0 then;t='Select ';else;t='Delete ';end;else;do;if v.15='M' then;t= 'Move ';else;t= 'Copy ';h2='<Y>es <N>o <C>ontinuous '||h||'<Escape>?';end;h=t||v.79||'?';h2='<Y>es <N>o <C>ontinuous '||t||'<Escape>?';l=78-length(h);cntr=3;say;if ff='Y' then;do;say msg1;say msg2;cntr=cntr+2;end;if l>0 then;h=h||center('',l,' ');say h;if ff='N' then;do;say msg2;cntr=cntr+1;end;say h2;call P41;do until pos(subword(ik,2,1),'YNC')>0 | subword(ik,1,1)='27';if v.53<>'N' then;beep(524,250);ik=P40();end;call P42(cntr);if subword(ik,1,1)='27' then;signal P36;if subword(ik,2,1)='N' then;do;v.68=v.68+1;fspcs.sel1.sel2='.';v.87='Y';end;if subword(ik,2,1)='C' then;do;v.58='Y';v.57='N';end;end;if v.61='N'&v.87<>'Y'&v.29='Y' then;do;if substr(v.77,4,1)='R'&pos(v.15,'MDR')>0 then;'attrib -R "'||v.78||'" 1>nul 2>nul';if substr(cf_a,4,1)='R'&pos(v.15,'DRS')=0 then;'attrib -R "'||v.8||v.95||'" 1>nul 2>nul';end;v.105=0;if v.87='Y' then;f_a_msg='*Bypassed';else;if v.15='R'|v.104='Y' then;f_a_msg='*Selected';else;if v.15='S' then;do;if v.43>0 then;f_a_msg='*Split Into '||format(((v.76/v.43)+.5),,0)||' Files';else;f_a_msg='*UnSplit';end;else;if v.15='D' then;f_a_msg='*Deleted';else;if v.15='M' then;f_a_msg='*Moved-';else;f_a_msg='*Copied-';fspcs.sel1.sel2='.';if v.40<>v.39 then;do;call P39('N' v.31 'Disk #'||v.39);v.91=0;v.40=v.39;end;v.33=v.33+1;v.84=' '||v.33||'. '||v.84||'  ';call P39('Y' v.52 v.84);call P41(v.52);col=length(v.84);if v.87='N' then;do;if v.22='Y' then;do;if substr(v.77,3,1)='H'|substr(v.77,5,1)='S' then;'attrib -S -H "'||v.78||'" 1>nul 2>nul';if substr(cf_a,3,1)='H'|substr(cf_a,5,1)='S' then;'attrib -S -H "'||v.8||v.95||'" 1>nul 2>nul';end;if v.30='Y'&ff='Y'&v.12<>'YY' then;do;ff='N';if v.61='N' then;call P17 v.8||v.95;end;if v.98='Y' then;v.105=-1;else;do;if pg.0>0 then;do;v.96=v.96||v.79||' ';v.97=v.97||v.78||' ';end;if v.15='R' then;NOP;else;if v.15='S'&v.43>0 then;do;if pos(' '||v.78||' ',v.97)=0 then;v.97=v.97||v.78||' ';end;else;if v.15='S'&v.43=0 then;do;l=P44(v.78);if pos(' '||left(v.78,l),v.97)=0 then;v.97=v.97||v.78||'+'||sel1||' ';end;else;if v.15='D' then;do;if v.61='N' then;v.105=SysFileDelete(v.78);end;else;if v.104='Y' then;v.105=0;else;if v.15='C' | left(v.78,1)<>left(v.8,1) | left(v.12,1)='Y' then;call P11;else;if v.15='M' then;call P12;if v.22='Y' & (substr(v.77,3,1)='H' | substr(v.77,5,1)='S') then;do;'attrib +S +H "'||v.78||'" 1>nul 2>nul';if pos(v.15,'MC')>0 then;'attrib +S +H "'||v.8||v.95||'" 1>nul 2>nul';end;end;if v.105<>0 then;ff='X';else;if left(v.12,1)='Y' then;v.58='Y';if ff<>'X' & v.83=0 & v.61='N' & v.104<>'Y' & pos(v.15,'DRS')=0 then;do;Call SysFileTree v.8||v.95, 'chk_fle.', 'FO';if chk_fle.0=0 then;ff='X';end;if ff='X' then;do;if v.15='D' then;f_a_msg='*Delete FAILED';else;if v.15='M' then;f_a_msg='*Move FAILED';else;if v.15='C' then;f_a_msg='*Copy FAILED';v.68=v.68+1;if v.105>0 then;do;if v.15='D'&v.105=5&substr(v.77,4,1)='R' then;f_a_msg=f_a_msg||' - Read Only';else;f_a_msg=f_a_msg||' RC='||v.105;end;end;else;If pos(v.15,'DSR')>0|v.104='Y' then;NOP;else;if ff='N'&v.12<>'YY' then;f_a_msg=f_a_msg||'New';else;if left(v.12,1)='Y' then;do;f_a_msg=f_a_msg||'Appended';v.12='YY';end;else;if v.88='Y' then;f_a_msg=f_a_msg||'Duplicate';else;f_a_msg=f_a_msg||'Replaced';if v.95<>v.79&pos(v.15,'DRS')=0 then;f_a_msg=f_a_msg||' ('||v.95||')';end;if ff='X'|v.87='Y' then;do;if v.52='N'&row>0 then;rc=SysCurPos(row-1,col);call P39('Y' v.52 f_a_msg);if v.24<>'' then;call P39('N' 'Y' v.84||f_a_msg);iterate;end;v.35=v.35+1;v.91=v.91+1;v.34=v.34+v.76;if v.15='C' then;do;if v.46='Y'&v.61='N'&v.105=0 then;'attrib -A "'||v.78||'" 1>nul 2>nul';end;else;if v.15='M'&v.105=0 then;do;if left(v.78,1)<>left(v.8,1) | left(v.12,1)='Y' | v.83>0 then;do;if v.61='N' then;do;rc=SysFileDelete(v.78);if rc<>0 then;f_a_msg='*Copied-'||substr(f_a_msg,8);end;end;end;if pos(v.15,'DRS')=0&v.61='N' then;if substr(v.77,4,1)='R' then;'attrib +R "'||v.8||v.95||'" 1>nul 2>nul';if v.28='Y' then;'copy "'||v.8||v.95||'" /B + ,, "'||v.8||v.95||'" 1>nul 2>nul';if v.52='N'&row>0 then;rc=SysCurPos(row-1,col);if v.83>0 then;f_a_msg=f_a_msg||' ('||strip(v.83,'L','0')||' Split Files)';call P39('Y' v.52 f_a_msg);if v.24<>'' then;call P39('N' 'Y' v.84||f_a_msg);end;v.1_fls='';return;P9:;arg sl;v.81=v.80;if v.85='Y' then;h='Bypassing  ';else;h='Processing ';if length(v.82)<63 then;call P39(sl v.31 h||'==> '||v.82||center('',63-length(v.82),' '));else;call P39(sl v.31 h||'==> '||left(v.82,63));if v.59='Y' then;do;ed=ed+1;sd.ed=strip(v.82,'T','\');end;return;P10:;parse arg s1 s2 wm;v.68=v.68+1;fspcs.s1.s2='.';if v.65='Y' then;do;sp=center('',length(v.33)+3,' ');call P39('N' v.52 sp||v.84||'  *Skipped-'||wm);end;return;P11:;if v.61='Y'|v.83>0 then;return;if left(v.12,1)='Y'&ff='Y' then;'copy "'||v.8||v.95||'"+"'||v.78||'"'||v.63||' 1>nul 2>nul';else;if v.76=0 then;do;if right(v.8,2)<>':\' then;h=strip(v.8,'T','\');else;h=v.8;'xcopy "'||v.78||'" '||h||v.63||' 1>nul 2>nul';end;else;'copy "'||v.78||'" "'||v.8||v.95||'"'||v.63||' 1>nul 2>nul';v.105=rc;return;P12:;if v.61='Y'|v.83>0 then;return;if ff='Y' then;v.105=SysFileDelete(substr(v.8,3)||v.95);if ff='N'|(ff='Y'&v.105=0) then;do;if left(v.1,1)<>left(v.78,1) then;call DIRECTORY(left(v.78,3));'move "'||substr(v.78,3)||'" "'||substr(v.8,3)||v.95||'" 1>nul 2>nul';if left(v.1,1)<>left(v.78,1) then;call DIRECTORY(v.1);v.105=rc;end;return;P13:;if DIRECTORY(v.5)<>'' then;do;call DIRECTORY(v.1);v.5=strip(v.5,'T','\')||'\';return;end;Call SysFileTree v.5, 'chk_fle.', 'F', s_a;v.79=FILESPEC('name',v.5);if (pos('.',v.79)>0&v.17='Y')| chk_fle.0>0| pos('*',v.79)>0| pos('?',v.79)>0 then;NOP;else;if v.11='D' then;v.5=strip(v.5,'T','\')||'\';else;do;if v.11<>'F' then;do;say;say 'Is "'||v.79||'" A <F>ile or <D>irectory?';call P41;do until pos(subword(ik,2,1),'FD')>0;if v.53<>'N' then;beep(524,250);ik=P40();if subword(ik,1,1)='27' then;signal P36;end;call P42('2');end;if subword(ik,2,1)='F'|v.11='F' then;NOP;else;v.5=strip(v.5,'T','\')||'\';end;return;P14: PROCEDURE EXPOSE v.79;arg n_s;fn.='';cn.='';do while pos('?',n_s)>0;l=pos('?',n_s);if l>1 then;n_s=left(n_s,l-1)||substr(v.79,l,1)||substr(n_s,l+1);else;n_s=substr(v.79,l,1)||substr(n_s,l+1);end;l=P44(v.79);if substr(v.79,l,1)='.' then;do;cn.1=left(v.79,l-1);cn.2=substr(v.79,l);end;l=P44(n_s);if substr(n_s,l,1)='.' then;do;fn.1=left(n_s,l-1);fn.2=substr(n_s,l);end;else;fn.1=n_s;if fn.1=''|fn.1='*' then;fn.1=cn.1;data=fn.1;do s=1 to 2;do while pos('*',fn.s)>0;l=pos('*',fn.s)-1;if pos('*',fn.s,l+2)>0 then;do;fn.s=overlay(substr(cn.s,l+1,1),fn.s,l+1);iterate;end;if l=0 then;do;fn.s=substr(fn.s,2);fn.s=left(cn.s,length(cn.s)-length(fn.s))||fn.s;end;else;do;fn.s=left(fn.s,l);if length(cn.s)>l then;fn.s=fn.s||substr(cn.s,l+1);end;end;end;return fn.1||fn.2;P15:;pd='';call P39('N' v.52 ' ');call P39('N' v.52 'Removing Empty Directories');call P41(v.52);do i=1 to ed;if pd=sd.i then;iterate;pd=sd.i;if P47(pd)='Y' then;iterate;Call SysFileTree sd.i||'\*.*', 'cdir.', 'DSO';do ii=cdir.0 to 1 by -1;call P16(cdir.ii);end;if length(sd.i)>3 then;call P16(sd.i);end;call P42('2');return;P16: PROCEDURE EXPOSE v.37 v.61;arg d;if v.61<>'N' then;return;rc=SysRmDir(d);if rc=16 then;do;call DIRECTORY(left(d,2)||'..');rc=SysRmDir(d);end;if rc=0 then;v.37=v.37+1;return;P17: PROCEDURE;arg rf;cd=DIRECTORY();call DIRECTORY(left(rf,3));l=P44(rf);if substr(rf,l,1)='.' then;do;ext=substr(rf,l+1,1);fn=left(rf,l-1);end;else;ext='';c=0;do until cf.0=0;c=c+1;if c<10 then;e=ext||'0'||c;else;e=ext||c;sf=fn||'.'||e;Call SysFileTree sf, 'cf.', 'F';if cf.0=0&c=99 then;do;rc=SysFileDelete(sf);leave;end;end;'MOVE "'||substr(rf,3)||'" "'||substr(sf,3)||'" 1>nul 2>nul';call DIRECTORY(cd);return;P18: PROCEDURE;arg d;do while pos('-',d)>0;d=overlay(' ',d,pos('-',d));end;do while pos('/',d)>0;d=overlay(' ',d,pos('/',d));end;d=space(d,0);if d='' then;d=substr(date('S'),3);else;if left(d,1)='+'|left(d,1)='-' then;do;dir=left(d,1);d=substr(d,2);end;do i = 1 to length(d);if pos(substr(d,i,1),'0123456789')=0 then;d='';end;if length(d)<5 then;d=P19(d);return d;P19: PROCEDURE;arg n_d;if dir='+' then;f=1;else;f=-1;n_j_d=date('D')+(n_d*f);n_j_y=substr(date('S'),3,2);if pos('.',n_j_y/4)>0 then;m_d=365;else;m_d=366;do while n_j_d<1|n_j_d>m_d;n_j_y=n_j_y+f;if pos('.',n_j_y/4)>0 then;m_d=365;else;m_d=366;n_j_d=m_d-(n_j_d*f);end;l=3-length(n_j_d);if l>0 then;n_j_d=center('',l,'0')||n_j_d;return P20(n_j_y||n_j_d);P20: PROCEDURE;arg r_j_dt2;r_j_yr=format(substr(r_j_dt2,1,2));r_c_j_d=format(substr(r_j_dt2,3,3));if pos('.',r_j_yr/4)>0 then;f='28';else;f='29';m_d='31 '||f||' 31 30 31 30 31 31 30 31 30 31';g_m=0;g_d=0;do until r_c_j_d<1;g_m=g_m+1;if g_m=13 then;do;g_m=1;r_j_yr=r_j_yr+1;end;d=subword(m_d,g_m,1);if (r_c_j_d-d)<1 then;g_d=r_c_j_d;r_c_j_d=r_c_j_d-d;end;l=2-length(g_m);if l>0 then;g_m=center('',l,'0')||g_m;l=2-length(g_d);if l>0 then;g_d=center('',l,'0')||g_d;return r_j_yr||g_m||g_d;P21:;i=1;do while subword(v.97,i,1)<>'';v.78=subword(v.97,i,1);v.76=chars(v.78);v.89=v.76;i=i+1;l=P44(v.78);if substr(v.78,l,1)='.' then;v.79=left(v.78,l-1);else;v.79=f;v.79=v.10||FILESPEC('name',v.79);v.87='N';v.5=left(v.79,3);call P23;if v.87='Y' then;do;call P39('N' v.52 'Not Enough Disk Space to Split '||v.78);iterate;end;if v.61='N' then;do s=0 to 10;'if exist '||v.79||'.'||s||'*'||' del '||v.79||'.'||s||'* 1>nul 2>nul';end;call P39('N' v.31 ' ');call P39('N' v.31 'Splitting the File '||v.78);call P41(v.31);s=1;cntr=0;do while chars(v.78)>0;if chars()>0 then;call P38;if s=1 then;do;l=v.76/v.43;if l<=1|l>999 then;leave;end;if v.61='Y' then;do;cntr=format(((v.76/v.43)+.5),,0);leave;end;cntr=cntr+1;l=3-length(cntr);if l>0 then;cntr=center('',l,'0')||cntr;new_v.79=v.79||'.'||cntr;call P33(s v.43 v.78 new_v.79);s=s+v.43;rc=stream(new_v.79,'C','CLOSE');end;call P42('2');f_splt=f_splt+cntr;if v.61='N' then;rc=stream(v.78,'C','CLOSE');end;return;P22:;v.78=subword(v.97,1,1);l=pos('+',v.78);fs=substr(v.78,l+1);v.78=left(v.78,l-1);l=P44(v.78);if substr(v.78,l,1)='.' then;v.79=left(v.78,l-1);else;v.79=v.78;j_fle=v.79||'.'||s_ext.fs;j_fle=v.10||FILESPEC('name',j_fle);v.5=left(j_fle,3);if pos(' '||j_fle,us_fn)=0 then;do;h='Creating';us_fn=us_fn||j_fle||' ';if v.61='N' then;rc=SysFileDelete(j_fle);end;else;h='Updating';call P39('N' v.31 ' ');call P39('N' v.31 h||' the File '||j_fle);call P41(v.31);cntr=0;do ii=1 to db.0;if chars()>0 then;call P38;if v.61='Y'|db.ii='' then;iterate;cntr=cntr+1;v.78=db.ii;v.76=chars(v.78);v.87='N';call P23;if v.87='Y' then;leave;s=1;do until s>=v.76;h=charin(v.78,s,1000000);s=s+1000000;rc=charout(j_fle,h);end;rc=stream(v.78,'c','close');if v.15h='M' then;rc=SysFileDelete(v.78);end;call P42('2');if v.87='Y' then;call P39('N' v.52 'Not Enough Disk Space to UnSplit '||v.78);rc=stream(j_fle,'c','close');drop(db.);return;P23:;v.90=P28(left(v.5,2));if ff='Y' then;v.90=v.90+cf_s;if (v.90-v.38)<1&v.15<>'S' then;call P24;else;if v.89>v.90 then;v.87='Y';return;P24:;strt_pos=1;v.83=0;v.100='N';do until v.100='N'&v.90>(v.76+v.38);if v.100='N'&v.14='Y' then;do;call P27;if v.87='Y' then;signal P36;end;say center('',78,' ');c=5;t='<N>=New Disk ';h='N';if v.100='Y' then;do;say 'Not Enough Diskspace for the Split File '||nxt_fn;t=t||' <ESC>=Quit';end;else;do;say 'Not Enough Diskspace for the file '||v.78;if v.13<>'Y' then;do;if v.90>1000 then;do;h=h||'BS';t=t||' <B>=Bypass File  <S>=Split File  <ESC>=Quit';end;else;do;h='BN';t=t||' <B>=Bypass File  <ESC>=Quit';end;end;end;say 'Required: '||P34(v.89)||'  Available: '||P34(v.90);ik='';if v.100='Y'|v.13='Y' then;c=3;else;do;say;say t;if v.53<>'N' then;beep(524,250);do until subword(ik,1,1)='27'| subword(ik,1,1)='13'| pos(subword(ik,2,1),h)>0;ik=P40();end;call P41;call P42(c);c=0;end;if pos(subword(ik,2,1),'N')>0 | v.100='Y' | v.13='Y' then;do;h='';t='Insert New Diskette in Drive '||left(v.6,2)||' and Press <ENTER> to Continue';t2='';if right(v.21,1)='N' then;do;t2=t2||' or <F> to Format New Disk';h=h||'F';end;if right(v.47,1)='N' then;do;t2=t2||' or <D> to Delete all Files on New Disk';h=h||'D';end;say;say t;c=c+2;if t2<>'' then;do;say t2;c=c+1;end;if pos('D',h)=0&subword(ik,2,1)<>'F' then;do;say 'ALL FILES ON NEW DISKETTE WILL BE DELETED BEFORE PROCESSING CONTINUES';c=c+1;end;if pos('F',h)=0 then;do;say 'NEW DISKETTE WILL BE FORMATTED BEFORE PROCESSING CONTINUES';c=c+1;end;if v.53<>'N' then;beep(524,250);do until subword(ik,1,1)='27'| subword(ik,1,1)='13'| pos(subword(ik,2,1),h)>0;ik=P40();end;call P41;call P42(c);end;if subword(ik,1,1)='27' then;do;if v.100='Y' then;rc=stream(full_v.79,'c','close');signal P36;end;if pos(subword(ik,2,1),'SB')=0&v.91>0 then;v.39=v.39+1;if subword(ik,2,1)='B' then;do;v.68=v.68+1;fspcs.sel1.sel2='.';v.87='Y';return;end;if subword(ik,2,1)='F' | (right(v.21,1)='Y'&subword(ik,2,1)<>'S') then;call P26;if subword(ik,2,1)='D' then;v.69='Y';else;v.69=right(v.47,1);v.93='';nx_dsk='N';nd='';if v.69='Y'&pos(subword(ik,2,1),'SF')=0 then;do;if v.61='N' then;call P25;v.69='N';end;if subword(ik,2,1)='S'|v.100='Y' then;do;call P27;if v.87='Y' then;signal P36;end;v.90=P28(left(v.5,2));end;if v.39>v.44 then;v.38=512;return;P25:;if pos(left(v.5,1),'AB')=0 then;do;if v.53<>'N' then;beep(524,250);say center('',78,' ');say '"/DF" Option only allowed for Drives A: and B:';say;signal P36;end;call DIRECTORY(left(v.5,3));call P39('N' v.52 'Deleting All Files on '||left(v.5,2));call P41(v.52);parse value SysDriveInfo(left(v.5,2)) with . . . h;if strip(h)='' then;h='RCOPY';'FORMAT '||left(v.5,2)||' /ONCE/Q/V:"'||h||'" 1>nul 2>nul';if rc<>0 then;call P26;call DIRECTORY(v.1);call P42('1');return;P26:;do until rc=0;call P39('N' v.52 'Formatting Drive '||left(v.5,2));call P41(v.52);if v.61='Y' then;leave;parse value SysDriveInfo(left(v.5,2)) with . . . h;if strip(h)='' then;h='RCOPY';'FORMAT '||left(v.5,2)||' /ONCE/V:"'||h||'" 1>nul 2>nul';if rc<>0 then;do;call P42('1');call P39('N' v.52 ' ');call P39('N' v.52 'Formatting Drive '||left(v.5,2)||' FAILED');call P29 left(v.5,2) 'Y';call P42('4');end;end;call P42('1');return;P27:;v.100='Y';call P30;if v.87='Y' then;return;fn=v.5||v.95;l=P44(fn);if substr(fn,l,1)='.' then;fn=left(fn,l-1);v.90=P28(left(v.5,2));if (v.76+v.38)<v.90 then;fs=v.76;else;fs=v.90;v.83=v.83+1;l=3-length(v.83);if l>0 then;v.83=center('',l,'0')||v.83;n_fn=fn||'.'||v.83;call P39('N' v.31 ' ');call P39('N' v.31 'Creating Split File '||n_fn||' ('||P34(fs)||' bytes)');call P39('N' v.31 '               From '||v.78);call P41(v.31);call P33(strt_pos fs v.78 n_fn);strt_pos=strt_pos+fs;v.90=v.90-fs;v.91=v.91+1;if v.61='N' then;rc=stream(n_fn,'c','close');v.76=chars(v.78);v.89=v.76;if v.76=0 then;do;v.100='N';rc=stream(full_v.79,'c','close');end;nxt_fn=v.83+1;l=3-length(nxt_fn);if l>0 then;nxt_fn=center('',l,'0')||nxt_fn;nxt_fn=fn||'.'||nxt_fn;f_splt=f_splt+1;call P42('3');return;P28:;arg dr;parse value SysDriveInfo(dr) with . ds .;if ds='' then;if pos(left(dr,1),'AB')>0 then;ds=P29(dr);else;ds=-1;return ds;P29:;parse arg dr nds;say '';say 'Place Diskette in Drive '||dr||' and Press <Enter> to Continue or <Esc> to Quit';call P41;do until ds<>'';if v.53<>'N' then;beep(524,250);ik=P40();if subword(ik,1,1)='27' then;signal P36;if nds='Y' then;leave;ds=P28(dr);end;v.64='N';call P42('2');return ds;P30:;v.98='N';v.99=strip(v.8,'T','\');fnd=P32(v.99);if fnd='Y' then;return;if v.100='N' then;do;nbr_sd=0;do l = 4 to length(v.8);if substr(v.8,l,1)='\' then;nbr_sd=nbr_sd+1;end;v.89=v.89+(nbr_sd*512);call P23;v.89=v.89-(nbr_sd*512);if v.87='Y' then;return;end;if v.18<>'Y' & v.57<>'Y' & v.100='N' & v.70<>'Y' then;do;if v.53<>'N' then;beep(524,250);say center('',78,' ');say 'The Directory '||v.99||' Does Not Exist.  Create it (Y/N)?';call P41;do until pos(subword(ik,2,1),'YN')>0 | subword(ik,1,1)='27';ik=P40();end;call P42('2');if subword(ik,1,1)='27' then;signal P36;if subword(ik,2,1)='N' then;do;v.98='Y';return;end;end;parse value P31(v.99||'\') with v.98 cd;if v.98='Y' then;return;nd=v.99;v.71=' (Directory Created)';return;P31: PROCEDURE EXPOSE v.93 v.61 v.1;arg r_d;d=r_d;do l=4 to length(r_d);if substr(r_d,l,1)='\' then;do;d=left(r_d,l-1);if P32(d)='N' then;do;if v.61='N' then;if SysMkDir(d)<>0 then;return 'Y';v.93=v.93||d||';';end;end;end;call DIRECTORY(v.1);return 'N' d;P32: PROCEDURE EXPOSE v.93 v.1;arg d;if pos(d||';',v.93)>0 then;return 'Y';if DIRECTORY(d)='' then;return 'N';v.93=v.93||d||';';call DIRECTORY(v.1);return 'Y';P33: PROCEDURE EXPOSE v.61;parse arg s_p g_s g_f p_f;do until g_s<1;if g_s<1000000 then;g=g_s;else;g=1000000;d=charin(g_f,s_p,g);s_p=s_p+g;g_s=g_s-g;if v.61='N' then;rc=charout(p_f,d);end;return;P34: PROCEDURE;arg n;if pos('.',n)>0 then;n=left(n,pos('.',n)-1);n=strip(n,'L','0');if n='' then;n=0;if length(n)<4 then;return n;h='';i=length(n)-2;do forever;h=','||substr(n,i,3)||h;if i<4 then;leave;i=i-3;end;if i>1 then;h=left(n,i-1)||h;return strip(h,'B',',');P35: PROCEDURE;parse arg d;do while pos('+',d)>0;d=overlay(' ',d,pos('+',d));end;return P48(d);P36:;if v.15='S' then;do;if v.43=0 then;do;i=1;do while strip(subword(us_fn,i,1))<>'';i=i+1;end;v.35=i-1;end;else;v.35=f_splt;end;call P39('N' v.54 center('',78,' '));if v.101>1 then;v.101='from '||v.101||' Diskettes ';else;v.101='';if v.15='R' then;t='Selected ';else;if v.15='S' then;t='Created ';else;t='Processed ';call P39('N' v.54 t||P34(v.35)||' Files '||v.101||'Containing '||P34(v.34)||' Characters.');if v.68>0 then;call P39('N' v.54 'Skipped '||P34(v.68)||' Files.  ');if v.37>0 then;call P39('N' v.32 'Removed '||P34(v.37)||' Directories.  ');if datatype(pg.0,'w')<>1 then;signal P37;lf='';mx_l=1000;if v.24<>'' then;do;lf=' >>'||v.24;mx_l=mx_l-3-length(v.24);end;do ps=1 to pg.0;v.102=subword(pg.ps,1,1);pg.ps=subword(pg.ps,2);if pg.ps='' then;iterate;if v.102>v.35 then;v.102=v.35;if lf<>'' then;do;l=pos('>',pg.ps);if l>0 then;pg.ps=strip(left(pg.ps,l-1),'T',' ');end;c_fn=' $ ';l=pos(c_fn,pg.ps||' ');if l=0 then;do;c_fn=' # ';l=pos(c_fn,pg.ps||' ');end;if v.97=''&l>0 then;iterate;i=1;t='';do until subword(v.97,i,1)='';if chars()>0 then;do;call P38 'Y';if subword(ik,1,1)='27' then;do;ps=pg.0;leave;end;end;h2='';do ii=1 to v.102;if c_fn=' $ ' then;fn=subword(v.97,i,1);else;fn=subword(v.96,i,1);fn='"'||fn||'"';if length(pg.ps)+length(lf)+length(h2)+length(fn)>mx_l then;leave;h2=h2||fn||' ';i=i+1;end;h=pg.ps||' ';if l=0 then;do;i=100;ii=v.102;end;else;do;do while pos('%',h)>0;h=left(h,pos('%',h)-1)||left(subword(h2,1,1),2)||substr(h,pos('%',h)+1);end;if pos('{',h)>0 then;do;cd=substr(subword(h2,1,1),3);if substr(h,pos('{',h)-1,1)=':' then;dr=substr(h,pos('{',h)-2,2);else;dr='';parse value P31(dr||cd) with v.98 cd;h=left(h,pos('{',h)-1)||substr(cd,length(dr)+1)||substr(h,pos('{',h)+1);end;do while pos(c_fn,h)>0;h=left(h,pos(c_fn,h))||strip(h2,'T',' ')||substr(h,pos(c_fn,h)+2);end;end;if t='' then;do;call P39('N' v.32 ' ');if l=0 then;t=' without Selected Files';else;if v.102=1 then;t=' for Each File Selected';else;if v.102=v.35&ps=1 then;t='  with Selected Files';else;t='  for Every '||P34(v.102)||' Selected Files';if v.55<>'' then;call P39('N' v.32 'Save to '||v.55||' an execution of "'||pg.ps||lf||'"');else;call P39('N' v.32 'Executing "'||pg.ps||lf||'"');call P39('N' v.32 t);call P39('N' v.32 ' ');end;if v.61='N' then;if v.55<>'' then;call lineout v.55,h||lf;else;do;if lf<>'' then;rc=stream(v.24,'c','close');'call '||h||lf;end;end;if v.55<>'' then;rc=stream(v.55,'c','close');end;P37:;if v.61='Y' then;do;call P39('N' v.52 '');call P39('N' v.52 center(' TEST RUN ONLY -- NO CHANGES ACTUALLY OCCURRED ',78,'*'));end;call P39('N' v.54 center('',78,' '));do i=1 to v.27;if i=1 then;say 'Press any key when ready . . .';call syssleep 1;if chars()>0 then;leave;end;call DIRECTORY(v.1);if v.24<>'' then;do;call lineout v.24, '****  RCOPY Ended at '||left(time('N'),5);call lineout v.24, ' ';rc=stream(v.24,'c','close');if v.103='Y' then;call P46(v.24);end;EXIT e_ok v.35 v.39 (v.33+v.68) v.34;P38:;arg sk_e;say;h='* Press Any Key to Continue or <ESC> to Quit';if F3K<>'' then;h=h||' (F3=/PGM Selected Files)';say h||' *';call P41;ik=P40();ik=P40();call P42('2');if (subword(ik,1,1)='27'|subword(ik,1,1)=F3K)&sk_e<>'Y' then;do;if subword(ik,1,1)='27' then;pg.0='';signal P36;end;return;P39: PROCEDURE EXPOSE v.24;parse arg s_l s_d d_m;if s_d='N' then;say d_m;if v.24<>''&s_l='N' then;call lineout v.24,d_m;return;P40: PROCEDURE;parse value SysGetKey('NOECHO') With k;kn=c2d(k);if kn=224|kn=0 then;do;parse value SysGetKey('NOECHO') With k;kn=kn+c2d(k);end;do while chars()>0;parse value SysGetKey('NOECHO') With c;end;return kn translate(k);P41:;arg s_d;if s_d<>'Y' then;parse value SysCurPos() With row col;return;P42: PROCEDURE EXPOSE row v.52;arg n_l;if v.52='N'&row>0 then;do;rc=SysCurPos(row-n_l,0);do b=1 to n_l;say center('',78,' ');end;rc=SysCurPos(row-n_l,0);end;return;P43: PROCEDURE;parse arg d l_t_d;h=left(d,2);d=strip(substr(d,3),'T','\')||'\';do i=1 to ABS(l_t_d);l=MAX(pos('\',d,2),1);d=substr(d,l);end;return h||d;P44: PROCEDURE;arg fn;if length(fn)=1 then;return 1;do l=length(fn) to length(fn)-3 by -1;if pos(substr(fn,l,1),':\.')>0|l=1 then;leave;end;return max(l,1);P45: PROCEDURE;arg r_f o_n;r='';do while lines(r_f);h=linein(r_f);if left(h,1)<>':' then;if o_n='Y' then;r=r||FILESPEC('name',h)||' ';else;r=r||h||' ';end;rc=stream(r_f,'c','close');return P48(strip(r,'B',' '));P46: PROCEDURE;arg f;c='';s=0;do while lines(f);d=strip(linein(f),'L',' ');if pos(' ==> ',d)>0 then;c=strip(subword(substr(d,pos(' ==> ',d)+4),1,1),'T','\')||'\';else;if datatype(left(d,1),'w')=1&right(subword(d,1,1),1)='.' then;if pos(' FAILED ',d)=0&pos('*Bypassed',d)=0 then;do;s=s+1;h.s=c||subword(d,2,1);end;end;rc=stream(f,'c','close');rc=SysFileDelete(f);do i=1 to s;call lineout f,h.i;end;rc=stream(f,'c','close');return;P47: PROCEDURE EXPOSE v.56;parse arg r;o=1;do while subword(v.56,o,1)<>'';h=substr(subword(v.56,o,1),pos(':',subword(v.56,o,1))+1);o=o+1;if right(h,1)='\' then;l=length(substr(r,3));else;l=length(h);if strip(h,'T','\')=left(substr(r,3),l) then;return 'Y';end;return 'N';P48: PROCEDURE;parse arg d;do while pos(',',d)>0;d=overlay(' ',d,pos(',',d));end;return d;