eignxing Posted July 8, 2009 Share Posted July 8, 2009 This does not seem to work for me and I'm feeling slow today. I just modified parts of the help file. What am I doing wrong? #include <Array.au3> ;=============================================================================== ; Example 2 (using a 2D array) ;=============================================================================== Local $avArray[6][2] = [ _ ["String0", "2009/03/24 12:34:25"], _ ["String1", "2009/03/25 11:34:25"], _ ["String2", "asdf"], _ ["String3", "2009/07/01 12:34:25"], _ ["String4", "2009/06/12 12:34:25"], _ ["String5", "2009/07/07 00:48:23"]] _ArrayDisplay($avArray, "$avArray") $sColumn = 1 $iIndex = _ArraySearch($avArray, "asdf", 0, 0, 0, 1, $sColumn) If @error Then MsgBox(0, "Not Found", '"' & "asdf" & '" was not found on column ' & $sColumn & '.') Else MsgBox(0, "Found", '"' & "asdf" & '" was found in the array at position ' & $iIndex & ' on column ' & $sColumn & '.') EndIf Link to comment Share on other sites More sharing options...
dantay9 Posted July 8, 2009 Share Posted July 8, 2009 (edited) The help file is wrong. I don't know if it is because of an update, but the example is missing a parameter. Before $sColumn, you need another parameter with a value of 1. This is the correct syntax for the example in the help file. #include <Array.au3> ;=============================================================================== ; Example 2 (using a 2D array) ;=============================================================================== Local $avArray[6][2] = [ _ ["String0", "SubString0"], _ ["String1", "SubString1"], _ ["String2", "SubString2"], _ ["String3", "SubString3"], _ ["String4", "SubString4"], _ ["String5", "SubString5"]] _ArrayDisplay($avArray, "$avArray") $sSearch = InputBox("_ArraySearch() demo", "String to find?") If @error Then Exit $sColumn = InputBox("_ArraySearch() demo", "Column to search?") If @error Then Exit $sColumn = Int($sColumn) $iIndex = _ArraySearch($avArray, $sSearch, 0, 0, 0, 1, 1, $sColumn) If @error Then MsgBox(0, "Not Found", '"' & $sSearch & '" was not found on column ' & $sColumn & '.') Else MsgBox(0, "Found", '"' & $sSearch & '" was found in the array at position ' & $iIndex & ' on column ' & $sColumn & '.') EndIf Edited July 8, 2009 by dantay9 Link to comment Share on other sites More sharing options...
eignxing Posted July 8, 2009 Author Share Posted July 8, 2009 Nice to know, thanks! Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 9, 2009 Share Posted July 9, 2009 I started to post that it was fixed in the Beta help file, but it's not. Bug Trac #1063 created for documentation tweak. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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