Jump to content

Variable subscript badly formatted


Recommended Posts

I'm stuck at this code line since almost a hour can't help myself

Func CalcAvgRoundOfStreaks()

Local $lostStreak = 0
Local $wonStreak = 0

    For $row=0 To UBound($ResultHistory,1)-1

        If $ResultHistory[$row][0] >= 2 Then
            $wonStreak = $wonStreak + 1
            If $lostStreak > 0 Then
                For $i=0 To UBound($L2StreakMemory,1)-1
                    If $L2StreakMemory[$i][$lostStreak-1] == "" Then
                        If $i == 0 Then
                            $L2StreakMemory[$i][$lostStreak-1] = $row
                        Else
                            $L2StreakMemory[$i][$lostStreak-1] = $row - $L2StreakMemory[$i-1][$lostStreak-1]
                        EndIf
                        ExitLoop
                    EndIf
                Next
            EndIf
            $lostStreak = 0
        ElseIf $ResultHistory[$row][0] < 2 Then
            $lostStreak = $lostStreak + 1
            If $wonStreak > 0 Then
                For $i=0 To UBound($G2StreakMemory,1)-1
                    If $G2StreakMemory[$i][$wonStreak-1] == "" Then
                        If $row == 0 Then
                            $G2StreakMemory[$i][$wonStreak-1] = $row
                        Else
                            $G2StreakMemory[$i][$wonStreak-1] = $row - $G2StreakMemory[$i-1][$wonStreak-1]
                        EndIf
                        ExitLoop
                    EndIf
                Next
            EndIf
            $wonStreak = 0
        EndIf
    Next

_ArrayDisplay($L2StreakMemory,"$L2StreakMemory")
_ArrayDisplay($G2StreakMemory,"$G2StreakMemory")


EndFunc


image.thumb.png.4cb4eed366ac15fe168bb1abbc386b92.png

Link to comment
Share on other sites

this:

 For $i=0 To UBound($L2StreakMemory,1)-1
  For $i=0 To UBound($G2StreakMemory,1)-1
Local $lostStreak = 0
Local $wonStreak = 0

should be:

 For $i=1 To UBound($L2StreakMemory,1)-1
Local $lostStreak = 1
Local $wonStreak = 1
  For $i=1 To UBound($G2StreakMemory,1)-1
Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...