View Full Version : Help please, Visual Basic 6

07-26-2007, 01:45 AM
Help, I'm having trouble with binary file manipulation:

Open Text1.Text For Binary As #1
Get #1, "&00765", val1
Get #1, "&00766", val2
Get #1, "&00767", val3
Get #1, "&00768", val4
Get #1, "&00769", val5
Text2.Text = Code2letter(CStr(val1)) + Code2letter(CStr(val2)) + Code2letter(CStr(val3)) + Code2letter(CStr(val4)) + Code2letter(CStr(val5))
Close #1

I got that, in Code2letter all I got is several If statements, this says it all:

Private Function Code2letter(Code As String)
If (Code = "00") Then
Code = "0"
End If

Note, there are more Ifs in that function and I didn't forget the "End Function", I didn't added the IFs because they are irrelevant.

I had to add those cStr() to try to convert the value to string since it wasn't working before. Now I get:
"Variable uses an Automation type not supported by Visual Basic"

Help please!