AnnA Posted January 7, 2006 Share Posted January 7, 2006 First time having to ask something that I could not find after enough searching through the forums. I was under the impression that the result of Func _ArrayPush(ByRef $avArray, $sValue, $i_Direction = 1) will be $sValue at the location $avArray[0] and each original value from $avArray[0] to $avArray[2nd last] will be moved up one position. e.g. Array with 1,2,3,4,5 --- Push 8 with direction 1 will result in 8,1,2,3,4 Currently it returns 8,2,3,4,5 In the UDF the line is :- "For $i = (UBound($avArray) - 1) To 1" Shouldn't it be "For $i = (UBound($avArray) - 1) To 1 Step -1" for the loop to be effective at all? -I'm sorry if this is a stupid question but the help file says "A For loop will execute zero times if: start > stop and step >= 0" -AnnA Link to comment Share on other sites More sharing options...
Developers Jos Posted January 7, 2006 Developers Share Posted January 7, 2006 First time having to ask something that I could not find after enough searching through the forums. I was under the impression that the result of Func _ArrayPush(ByRef $avArray, $sValue, $i_Direction = 1) will be $sValue at the location $avArray[0] and each original value from $avArray[0] to $avArray[2nd last] will be moved up one position. e.g. Array with 1,2,3,4,5 --- Push 8 with direction 1 will result in 8,1,2,3,4 Currently it returns 8,2,3,4,5 In the UDF the line is :- "For $i = (UBound($avArray) - 1) To 1" Shouldn't it be "For $i = (UBound($avArray) - 1) To 1 Step -1" for the loop to be effective at all? -I'm sorry if this is a stupid question but the help file says "A For loop will execute zero times if: start > stop and step >= 0" -AnnA Sounds like you found a BUG in the _ArrayPush() UDF. Will update it in the next release.... Thanks SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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