Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jul 2007
    Latin America
    Thanked 0 Times in 0 Posts

    Help please, Visual Basic 6

    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!
    Last edited by Boshi; 07-26-2007 at 02:41 AM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts