CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Characters

  1. #1
    Join Date
    May 1999
    Posts
    5

    Characters

    Hi,
    i have a problem with characters in Visual basic. somehow i need a character array and VB has something called Byte which is similar to that. i have the following code.

    Dim hfiles as String * 80
    Dim i As Integer
    Dim temp(80) As Byte
    Dim midchar As String

    hfiles = "C:\Refprop\FLUIDS\R32.fld"

    For i = 1 To 80
    midchar = Mid(hfiles, i, 1)
    temp(i) = CByte(midchar)
    Next i

    it is supposed to convert the character to byte but it is still giving a type mismatch error. Could anyone please tell me why this is happenning and how i could correct it.
    Thanks,
    Veluru


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Characters

    you can assign a string to a byte array like this

    Dim str1 as string * 10
    str1 = "test"
    Dim b() as Byte
    b = str1





Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured