I'm a vb newbie, and I am trying to retrieve some variable length strings (City names) from a binary file. The binary file contains data from which I can determine the strings' locations and lengths. Right now, I am just trying to display the data, but I'm having problems. My code is as follows:
Dim strName() as String
...
While...
MsgBox "nameLen=" & nameLen
ReDim strName(1 to nameLen)
Get #nFileNum, namLoc, strName
MsgBox "strName=" & strName
...
Wend
Now, for my first retrieval in my test, I am getting "nameLen=10", and then "strName=Cleveland", which looks right. For the next retrieval, I am "nameLen=6", and then "strName=DallasV<||...(etc.)", which is all messed up. Can someone tell me what I'm doing wrong? By the way, if I try to make my second display 'MsgBox strName & "<some other text>", the <some other text> does not show up for either retrieval. Basically appending text to the field name does not work in any case. Any ideas?
Dim strName() as String
...
While...
MsgBox "nameLen=" & nameLen
ReDim strName(1 to nameLen)
Get #nFileNum, namLoc, strName
MsgBox "strName=" & strName
...
Wend
Now, for my first retrieval in my test, I am getting "nameLen=10", and then "strName=Cleveland", which looks right. For the next retrieval, I am "nameLen=6", and then "strName=DallasV<||...(etc.)", which is all messed up. Can someone tell me what I'm doing wrong? By the way, if I try to make my second display 'MsgBox strName & "<some other text>", the <some other text> does not show up for either retrieval. Basically appending text to the field name does not work in any case. Any ideas?