3
Reply

Value of type '1-dimensional array of Byte' cannot be converted to 'Byte

Celldet

Celldet

Nov 3 2008 11:20 PM
18.6k
I am having a problem with code when assigning values.  I continue to get the above error on line 3.  Where am I going wrong?

Dim Buffer As Byte() = New Byte(&H2710 - 1) {}
        Dim numRef As Byte
        numRef = Buffer
        Dim num2 As Integer
        Dim seemNum As UInt32 = Convert.ToUInt32(hexSeem, &H10)
        If (seemNum <> 0) Then
            num2 = Seem_Read(seemNum, recNum, startOff, bytes, numRef)
        Else
            num2 = Seem_Read(0, recNum, startOff, bytes, numRef)
        End If
        If num2 <> -1 Then
            Dim buffer3 As Byte() = New Byte(num2 - 1) {}
            Dim i As Integer
            For i = 0 To num2 - 1
                buffer3(i) = buffer(i)
            Next i
            Return buffer3
        End If
        Return Nothing

Thanks



Answers (3)