Hi Karl,
If you want view the contents of a file in a meaningful way you may want to consider displaying it in hexadecimal format. All of the decent "binary" file viewers/editors I've seen do it that way: a column of six-digit hexadecimal addresses followed by sixteen columns of hexadecimal values followed by the actual characters found in each of the 16-byte paragraphs. You could always include an option to display in binary (if you are willing to squint that hard).
One way to do this would be to set up a grid with 16 colums and 16 rows. Create a file buffer (a fixed length string) 256 bytes long, open a file in Binary mode and use the Get statement to read the first 256 bytes of the file.
Set up two nested For/Next loops, each to repeat 16 times. (This would be a lot easier to express with code but since you seem to be a do-it-yourself kind of guy, I'll let your own skills lead you to a solution).
Inside the first loop, initialize an empty string. You will use it to populate each row of the grid. Inside the second loop we'll go through the current 16-byte paragraph, getting the value of each byte, converting it to a two-byte hexadecimal string and concatenating it with the first string. Use something like:[tt]
First$ = First$ & Hex$(Asc(Mid$(GotFromFile$,CurrentPos,1))) & VbTab[/tt]
(The VbTab will help populate an entire grid row. You'll have to increment CurrentPos every time you get a byte.)
Repeat that 16 times for each of 16 grid rows, clearing the first string inside the first loop. You might also want to include the actual characters in the paragraph in another 16 columns to the right. And a hex address to the left (it will keep you from getting lost when you start navigating the Windows swap file). ;-)
Good luck. This could turn into a challenging project for you.
Alt255@Vorpalcom.Intranets.com