###User Defined Function###
_ArraySearch

###Description###
Finds an entry within a 1D or 2D array. Similar to _ArrayBinarySearch(), except that the array does not need to be sorted.

###Syntax###
#include <Array.au3>
_ArraySearch ( Const ByRef $avArray, $vValue [, $iStart = 0 [, $iEnd = 0 [, $iCase = 0 [, $iCompare = 0 [, $iForward = 1 [, $iSubItem = -1]]]]]] )


###Parameters###
@@ParamTable@@
$avArray
	The array to search
$vValue
	What to search $avArray for
$iStart
	[optional] Index of array to start searching at
$iEnd
	[optional] Index of array to stop searching at
$iCase
	[optional] If set to 1, search is case sensitive
$iCompare
	[optional] 
		0 Casting of variables to the same type (default), "string" = 0, "" = 0 or "0" = 0 match (If $iCase = 0)
		1 executes a partial search
		2 comparison match if variables have same type and same value
		3 compares using a regular expression pattern provided as $vValue
$iForward
	[optional] If set to 0, searches the array from end to beginning (instead of beginning to end)
$iSubItem
	[optional] Sub-index to search on in 2D arrays
@@End@@

###ReturnValue###
@@ReturnTable@@
Success:	the index that $vValue was found at.
Failure:	-1 and sets the @error flag to non-zero.
@error:	1 - $avArray is not an array
	2 - $avArray is not a 1 or 2 dimensional array
	3 - $avArray is empty
	4 - $iStart is greater than $iEnd
	6 - $vValue was not found in array
	7 - $avArray has too many dimensions
@@End@@


###Remarks###
This function might be slower than <a href="_ArrayBinarySearch.htm">_ArrayBinarySearch()</a> but is useful when the array's order can't be altered.


###Related###
_ArrayBinarySearch, _ArrayFindAll


###Example###
@@IncludeExample@@
