RuHor Posted August 30, 2022 Share Posted August 30, 2022 (edited) Hello, I'm trying to understand what this line of code means, but I can't figure out what value it takes inside the bracket $i = 1 $aArray[$i + 2] Because I don't think it is equal to $aArray[3] because I did tests and it is not the value of index 3. In other words, send the value of index 3 and it is not the value that I get in relation to $i + 2 Edited August 30, 2022 by RuHor Link to comment Share on other sites More sharing options...
Subz Posted August 30, 2022 Share Posted August 30, 2022 (edited) Arrays are 0 index based, so for example: ;~ Example 1 Local $aArray[6] = [0,1,2,3,4,5] Local $i = 1 ConsoleWrite($aArray[$i + 2] & @CRLF) ;~ Result: $aArray[1+2] = 3 ;~ Example 2 Local $aArray[6] = [1,2,3,4,5,6] Local $i = 1 ConsoleWrite($aArray[$i + 2] & @CRLF) ;~ Result: $aArray[1+2] = 4 Edited August 30, 2022 by Subz Link to comment Share on other sites More sharing options...
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