Original Post
Hi. Sorry if this was already answered somewhere else, but all my searches were of no help. I'm trying to store, via "Put," a byte array (a string) to a file and recover it. Here's a small program that should, afaik, produce these results:
Dim saveText() As Byte
Dim loadText() As Byte
ReDim saveText(11) As Byte
ReDim loadText(11) As Byte
saveText = "Hello World"
Open "test.txt" For Binary As #1
Put #1, , saveText()
Close #1
Open "test.txt" For Binary As #1
Get #1, , loadText()
Close #1
MsgBox saveText()
MsgBox loadText()
The output is a msgbox with the caption "Hello World" followed by a msgbox with the caption "Hello." Can someone please tell me wtf is going on here?
-Brian
--------
EDIT
Check out the contents of "test.txt":
H e l l o W o r l d
Why does it store a character, a blank space, a character, etc.? And why won't it load it like that?
Edited by - shawncorn on January 1, 2002 9:36:19 PM