home *** CD-ROM | disk | FTP | other *** search
- 0 rem *** redirect c-128 ***
- 10 printchr$(147)tab(16)chr$(18)"redirect"
- 20 l$=" --------------------------------------"
- 30 j=0:s=1:n$="":print:print"file name? ";:printchr$(34);
- 40 poke2599,0:geta$:ifa$=""then40
- 50 ifa$=chr$(13)thenpoke2599,1:printchr$(34)a$:goto110
- 60 ifj>15thenpoke2599,1:printa$:goto100
- 70 ifa$=chr$(20)andj<1then40
- 80 printa$;:ifa$=chr$(20)thenj=j-1:n$=left$(n$,j):goto40
- 90 n$=n$+a$:j=j+1:goto40
- 100 print:printchr$(18)"you are over the 16 character limit.":goto30
- 110 ifn$=""thenprintchr$(18)"please enter a file name.":goto30
- 120 ifn$="$"then(NULL):poke208,0:gosub460:close15:printl$:goto30
- 130 r$=chr$(34)+n$+chr$(34)
- 140 print"searching for ";r$
- 150 iflen(n$)<16thenn$=n$+chr$(160):goto150
- 160 open15,8,15:open5,8,5,"#"
- 170 print#15,"u1";5;0;18;s:gosub470:l=4
- 180 b$="":j=1
- 190 print#15,"b-p";5;j+l:get#5,a$:ifa$=""thena$=chr$(0)
- 200 b$=b$+a$:ifleft$(b$,j)<>left$(n$,j)then230
- 210 j=j+1:ifj>16then280
- 220 goto190
- 230 l=l+32:ifl<229then180
- 240 forp=0to1:print#15,"b-p";5;p:get#5,a$:ifa$=""thena$=chr$(0)
- 250 a(p)=asc(a$):nextp:ifa(0)<>18ora(1)<1ora(1)>18then270
- 260 s=a(1):goto170
- 270 print:print"unable to locate ";r$:goto380
- 280 gosub430:print:printl$:ifct=1then300
- 290 f1$=f2$:s1=s:l1=l:ct=1:close5:close15:goto30
- 300 print"swapping...":printl$
- 310 print#15,"u1";5;0;18;s:gosub470
- 320 print#15,"b-p";5;l:print#5,f1$;
- 330 print#15,"u2";5;0;18;s:gosub470
- 340 print#15,"u1";5;0;18;s1:gosub470
- 350 print#15,"b-p";5;l1:print#5,f2$;
- 360 print#15,"u2";5;0;18;s1:gosub470
- 370 print"done..."
- 380 close5:close15:printl$:print
- 390 input"another swap (y/n/$)";a$:ifa$="y"thenclr:goto10
- 400 ifa$="n"thenend
- 410 ifa$="$"then(NULL):poke208,0:gosub460:close15:printl$:print
- 420 goto390
- 430 f2$="":l=l-2:forj=0to29
- 440 print#15,"b-p";5;j+l:get#5,a$:ifa$=""thena$=chr$(0)
- 450 f2$=f2$+a$:nextj:return
- 460 open15,8,15
- 470 input#15,en,em$,et,es:ifen=0thenreturn
- 480 printen;em$;et;es:close5:close15:end
-