Luigi Posted September 7, 2011 Posted September 7, 2011 (edited) Hi, I try find a value in one $avArray, get your position, and retrieve another value in the same position in anoter $avArray2. It's work with any value <> 0. If I search 'a' letter, the script return all $avArray2... But I want only letter 'A'. I make wrong code or exist sintax error? #include <Array.au3> Local $avArray[5] = ["a", "b", "c", "d", "e"] Local $avArray2[5] = ["A", "B", "C", "D", "E"] $find = "b" Local $aiResult = _ArrayFindAll($avArray, $find) ConsoleWrite("The letter '" & $find & "' was found in position '" & _ArrayToString($aiResult) & "'." & @LF) ConsoleWrite(_ArrayToString($avArray2,"",_ArrayToString($aiResult),_ArrayToString($aiResult)) & @LF) Thanks. ^^ Edited September 7, 2011 by detefon Visit my repository
Herb191 Posted September 7, 2011 Posted September 7, 2011 I am not sure if this is what your are looking for... #include <Array.au3> Local $avArray[6] = ["a", "b", "c", "d", "e", "f"] Local $avArray2[6] = ["A", "B", "C", "D", "E", "A"] $find = "a" Local $aiResult = _ArrayFindAll($avArray, $find) ConsoleWrite("The letter '" & $find & "' was found in position '" & _ArrayToString($aiResult) & "'." & @LF) For $i = 0 To UBound($aiResult, 1) -1 ConsoleWrite($avArray2[$aiResult[$i]] & @LF) Next
Luigi Posted September 7, 2011 Author Posted September 7, 2011 Yes Herb191, that is this! Work fine, thank you! Namaste! Visit my repository
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