Jump to content

arraysearch, is this a bug?


 Share

Recommended Posts

Hi guys, can you help me out a bit here?

I have an $arrayx[10][11]

$arrayx[6][11] = "h2o"

I tried to search what row that has "h2o" but failed, so I make a simple test a "2d" array first

#include <Array.au3>
Local $avArray[6][2] = [ _
["String0", "am2"], _
["String1", "am6"], _
["String2", "am9"], _
["String3", "am4"], _
["String4", "hail"], _
["String5", "am3"]]

$sSearch = InputBox("_ArraySearch() demo", "String to find?")
If @error Then Exit

For $i=0 to 3 ;-- ignore this, cuz maybe I got it upside down
    $iIndex = _ArraySearch($avArray, $sSearch, 0, 0, 0, 0, $i)
    If @error Then
        MsgBox(0, "Not Found", '"' & $sSearch & '" was not found on column ' & $i & '.')
    Else
        MsgBox(0, "Found", '"' & $sSearch & '" was found in the array at position ' & $iIndex & ' on column ' & $i & '.')
    EndIf
Next

The result "am4" is nowhere to be found, is this correct?

Edited by danny1878
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...