Binary File Input/Output.
Posted on 1998-07-07
Heres my problem:
I have a routine that gives me variable length binary data. I wish to store that in a small file and
then read it back. I don't want to use Random file access because of the fixed length read/write;
The binary file must be smaller than that. Here is what I tried (It doesn't work):
Open OutFile For Binary As #1 ' Open Output File
Put #1, ,MyData1 ' Variable Length Binary Data
Put #1, ,MyData2
Put #1, ,MyData3
Close #1 ' Close Input
Open InFile For Binary As #1
' What do I do here?
' if I use Mystring = Input(1,#1)
' then I will only get one char or byte.
' I need to read in each string of binary data as it was written!
' You can't use record numbers in binary mode, just in Random (fixed length)mode.