Reputation: 15399
I have a variable declaration as follows -
Public CA() As Byte
When I want to write the contents of this to a file, I do the following -
myStr = StrConv(CA, vbUnicode)
intFileHandle = FreeFile
Open "myFile.txt" For Output As #intFileHandle
Print #intFileHandle, myStr
Close #intFileHandle
However, I am not sure whether this is the correct way. Could you recommend a correct way to write the contents of the byte array to the file?
Upvotes: 1
Views: 6662
Reputation: 10407
dim fnum As Integer
fnum = FreeFile()
Open "myFile.txt" For Binary As #fnum
Put #fnum, 1, CA
Close fnum
Upvotes: 4