home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
CPM
/
UTILS
/
F
/
PWAIDS.ARK
/
SWPREAD.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-09-27
|
2KB
|
99 lines
$lines
var c1=real
var c2,i=integer
dim char a(30)
var b=char
print chr(26)
text 0,$
SWPREAD To retrieve text from Perfect Writer PW.SWP file up to 62k
Don Davis May 6, 1984
Inspired by Edmund Bolles (KUGRAM 2:2, 1984)
Run SWPREAD from drive A. Then put PW.SWP in
drive A and a diskette with adequate space in drive B.
$
input3 "Hit any key when ready";b
files D,D,S(1),S(1)
rename "b:SWAP.MSS" to "b:SWAPMSS.OLD"
create "b:SWAP.MSS"
open #2,"a:PW.SWP"
open #3,"b:SWAP.MSS"
print
print
print "Bypassing configuration data"
for c1=1 to 1024
read #2;b
next c1
print
print "Creating b:SWAP.MSS"
print
for c1=1 to 62
for c2=1 to 1024
rem READ A CHARACTER OF PW.SWP AND TEST WHETHER WANTED
10 read #2;b
if b>chr(31) and b<chr(160) or b=chr(9) or b=chr(10) or b=chr(13) then
begin
if b=chr(13) then
begin
i=1
repeat
begin
read #2;a(i)
rem ABOVE: IF ^M [chr(13)] FOUND, LOOK FOR ANOTHER WITHIN 30 CHARACTERS
rem BELOW: IF 2ND ^M FOUND, DISCARD INTERVENING CHARACTERS AND RESUME AT 10
if a(i)=chr(13) then 10
else i=i+1
end
until i=30
rem IF NO 2ND ^M WITHIN 30 CHARACTERS, SAVE THE SEARCHED CHARACTERS AND...
for i=1 to 29
if a(i)>chr(31) and a(i)<chr(160) or a(i)=chr(9) or a(i)=chr(10) then
begin
print a(i);
write #3;a(i)
end
next i
rem ...RESUME AT 10
goto 10
end
else begin
print b;
write #3;b
rem ABOVE: SAVE DESIRED CHARACTERS
end
end
next c2
rem OPPORTUNITY TO STOP EVERY 5k
if c1/5=int(c1/5) then
begin
print
print
print c1;"k have been read. ";
input3 "Continue reading? (Y or N)";b
if b='n' or b='N' then 0out
print
print
end
else begin
print
print
print c1;"k read"
print
end
next c1
rem ADD END OF FILE
0out b=chr(26)
write #3;b
close #3
print chr(26)
text 0,$
Recovered text is in b:SWAP.MSS
BEFORE editing b:SWAP.MSS, make a copy
of the PW.SWP you have just read.$
end
S
rem BELOW: IF 2ND ^M FOUND, DISCAR