AndroidZero Posted March 23, 2022 Posted March 23, 2022 I'm stuck at this code line since almost a hour can't help myself expandcollapse popupFunc 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
ad777 Posted March 23, 2022 Posted March 23, 2022 (edited) 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 March 23, 2022 by ad777 AndroidZero 1 none
AndroidZero Posted March 23, 2022 Author Posted March 23, 2022 Thanks! I'm getting often lost in Array dimensions
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now