Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Top4 Data Compression (compressor and decompressor included)
#7
Two different functions: ```LOC()``` returns the current byte position in the file. ```LOF()``` returns the total size in bytes of the file.

So the line of code shown above was trying to determine how close it was moving forward toward the end of the file. If it was getting too close to the end then the code block controlled by ```IF... THEN... ENDIF``` doesn't execute.

The code could be clearer like this:

Code: (Select All)
DIM MYFILELEN AS LONG, MYFILE AS LONG
MYFILE = FREEFILE
OPEN "thisfile.bin" FOR BINARY AS MYFILE
MYFILELEN = LOF(MYFILE)
': some code
IF MYFILELEN - LOC(MYFILE) >= 32767 THEN
':if/then block
END IF
': some more code
CLOSE MYFILE
Reply


Messages In This Thread
RE: Top4 Data Compression (compressor and decompressor included) - by mnrvovrfc - 12-13-2023, 04:29 PM



Users browsing this thread: 1 Guest(s)