Quote:
|
Originally Posted by complete
In Visual Basic 6 I have written a program to read and write to a file. It works fine. Now I have to do the same for binary data since the information I write to the file has end-of-line and return characters. For instance, when I write to the file, the data looks like this:
"3
34"
Because there is a break in the data. In debug mode, the text data has two boxes where the end-of-line and return characters go.
Anyway, does anyone have any example code of binary level reading and writing to and from a file?
|
Use the "Binary" mode, eg
Code:
Open "myfile" For Binary As #1
You then use the Get and Put statements to read/write data.
Please read the docs first, though. Binary mode files do not know sizes of data blocks; it loads enough data to fill the variable.