So, another VB6 question.



  • This is getting annoying.. How can I get Split() to take a Byte array, and output using numbers, like: 1,5,60,200,129,104


    I tried writing my own function, but I apparently cannot return arrays from a function. This is what I got:


    Public Function sSplit(srcString As String, delim As String) As Byte

    Dim TempArr() As String

    Dim Dest() As Byte

    Dim TempInt As Integer



    If srcString = "" Then sSplit = Dest: Exit Function



    TempArr = Split(srcString, delim)

    ReDim Preserve Dest(UBound(srcString)) As Byte

    For TempInt = 0 To UBound(TempArr)

    Dest(TempInt) = Val(TempArr(TempInt))

    Next TempInt



    sSplit = Dest

    End Function



    Any easy way to do this, or am I stuck? :/



  • Well, I can't edit it for some reason, so.. I managed to fix the problem. :P


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.