excelent. Il be number two, Im no expert in file compression but i was chuffed to see this work quite nicely!:
Function simplecompress(name$,outputname$)
fs=WriteFile(outputname$)
fs2=ReadFile(name$)
bt=0
Repeat
count=0
Repeat
obt=bt
bt=ReadByte(fs2)
count=count+1
Until (bt<>obt And obt<>-1) Or count>254 Or Eof(fs2)
WriteByte fs,count
WriteByte fs,obt
Until Eof(fs2)
CloseFile fs2
CloseFile fs
DeleteFile name$
End Function
Function simpledecompress(name$,tempname$)
fs=WriteFile(tempname$)
fs2=ReadFile(name$)
dn=0
Repeat
count=ReadByte(fs2)
Char=ReadByte(fs2)
If dn>0 Then For z=1 To count:WriteByte fs,char:Next
dn=1
Until Eof(fs2)
CloseFile fs2
CloseFile fs
End Function
Problem being with mine, a file with every char different ends up twice the size....
..and....
Anyone tell me how to put that into a code box???
Function simplecompress(name$,outputname$)
fs=WriteFile(outputname$)
fs2=ReadFile(name$)
bt=0
Repeat
count=0
Repeat
obt=bt
bt=ReadByte(fs2)
count=count+1
Until (bt<>obt And obt<>-1) Or count>254 Or Eof(fs2)
WriteByte fs,count
WriteByte fs,obt
Until Eof(fs2)
CloseFile fs2
CloseFile fs
DeleteFile name$
End Function
Function simpledecompress(name$,tempname$)
fs=WriteFile(tempname$)
fs2=ReadFile(name$)
dn=0
Repeat
count=ReadByte(fs2)
Char=ReadByte(fs2)
If dn>0 Then For z=1 To count:WriteByte fs,char:Next
dn=1
Until Eof(fs2)
CloseFile fs2
CloseFile fs
End Function
Problem being with mine, a file with every char different ends up twice the size....
..and....
Anyone tell me how to put that into a code box???