Closed ghost closed 3 years ago
It is true that 8 digits would be best for a large file, but who would scroll through gigabytes of data? For small files, the extra zeroes just add clutter. It would be better to have offset digits dynamic and/or configurable.
Nice to see hexdump in FreeBASIC!!
I notice you use 6 hexadecimal digits for
fileIndex
which is just sufficient for 16MB file size!Print Hex(fileIndex,6);Space(tabWidth);hexBytes;Space(tabWidth);asciiBytes
In FAT32 system, normally we accommodate 8 hexadecimal digits for file offset, which is 4GB (2^32).
As stated in FreeBASIC documentation , GET command read a file position of longint (64-bit).
So I think it is best to at least change the
Hex(fileIndex,6)
toHex(fileIndex,8)
.Cheers!