home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
ST_USER
/
1990
/
USERJL90.MSA
/
LISTINGS.ARC
/
RLD.BSC
< prev
next >
Wrap
Text File
|
1990-05-16
|
521b
|
22 lines
REM Run Length Decoding - by R.A.Waddilove
INPUT "File to decompact:"i$
INPUT "New filename:"o$
DELFILE o$ : \just a precaution
PRINT:PRINT "Decoding file..."
I%=OPENIN i$ : \open file to compact
flag%=BGET#I% : \get run length flag
O%=OPENOUT o$ : \open file to create
REPEAT
byte%=BGET#I%
IF byte%=flag% THEN
byte%=BGET#I% : count%=BGET#I%
FOR J%=1 TO count%
BPUT#O%,byte% : \ run of count%, bytes%
NEXT
ELSE
BPUT#O%,byte%
ENDIF
UNTIL EOF#I%
CLOSE#I%:CLOSE#O% : \close files
END