Results 1 to 9 of 9

Thread: A Woozie Moment.     submit to reddit submit to twitter

  1. #1
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    A Woozie Moment.

    Oh my god, I can't believe I can't figure this out. I have an array that I need to read two values right next to each other via a loop.

    How do I do this?

    so this is my problem in stupid terms:

    I have something that is adding 1 every time it loops, and it needs to add the value directly next to it.

    ex:

    Code:
        For i = 0 To UBound(strCommand)
            MsgBox strCommand(i) & " :: " & strCommand(i + 1)
        Next i
    So this obviously wont work because it would go 1-2, 2-3, etc. I need it to go 1-2, 3-4, 5-6

    how I do dis.

    fuck you because I know I've done this before but I'm totally brain farting and all that jazz.

  2. #2
    Canadian Fury
    MANITOBA IS NOT A REAL PLACE

    Join Date
    Jun 2008
    Posts
    1,089
    BG Level
    6
    FFXI Server
    Valefor

    don't be a pedofag

  3. #3
    Rainbow Dash was here,
    Applejack is a silly filly.

    Join Date
    Jan 2008
    Posts
    1,425
    BG Level
    6

    Oh well nevermind then

  4. #4
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    tried that numbers,
    its not working though
    Code:
        Replaced = Replace(strInput, "-", ";")
        strCommand = Split(Replaced, ";")
        
        For i = 0 To UBound(strCommand)
            str1 = strCommand(i)
            For j = 0 To UBound(strCommand) Step 2
                str2 = strCommand(j)
            Next j
            MsgBox str1 & " :: " & str2
        Next i

  5. #5
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    Wait, you cant loop inside a loop D: HOW DO I DO DIS

  6. #6
    Users Awaiting Email Confirmation
    Join Date
    Jul 2005
    Posts
    5,667
    BG Level
    8

    Do that thing where you add the characters to the code that makes it work.

  7. #7
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    tell me char

  8. #8
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    Code:
        Replaced = Replace(strInput, "-", ";")
        strCommand = Split(Replaced, ";")
        
        For i = 0 To UBound(strCommand) Step 2
            str1 = strCommand(i)
            j = i + 1
            str2 = strCommand(j)
            MsgBox str1 & " :: " & str2
        Next i
    Fucking simple shit becoming hard is retarded.

  9. #9
    Banned.

    Join Date
    Jul 2005
    Posts
    5,821
    BG Level
    8
    FFXI Server
    Sylph
    WoW Realm
    Arthas

    Non shit version of that...
    Code:
    Function InsertNewData(strInput As String, strTable As String)
    Dim strCommand() As String
    Dim Replaced As String
    Dim i As Long
    
        Replaced = Replace(strInput, "-", ";")
        strCommand = Split(Replaced, ";")
        
        For i = 0 To UBound(strCommand) Step 2
            MsgBox strCommand(i) & " :: " & strCommand(i + 1)
        Next i
    end function
    just in debugging but its going to make shit a lot easier.