;; 
;;=====================================================================================----- 
;; 
;;FUNCTION       mAscan() 
;; 
;;ACTION         Ascan() for multidimensional arrays 
;; 
;;AUTHOR         Lonkero 
;; 
;;VERSION        1.0 - 2009/02/18 
;; 
;;SYNTAX         mAscan(ARRAY, EXPRESSION, START, DIMENSION, [ASCAN_FLAGS]) 
; 
;;PARAMETERS      
;;               ARRAY - Required - Array 
;;               - Multidimensional (not array of arrays) array to scan 
;;               EXPRESSION - Required - String 
;;               - Search Expression 
;;               START - Required - Integer List 
;;               - Space separated list of dimension indexes for the scan 
;;               DIMENSION - Required - Integer 
;;               - Single dimension to scan (other values based on the start value) 
;;               ASCAN_FLAGS - Optional - Integer 
;;               - Same as built-in AScan() - See Kixtart User Guide. 
;; 
;;REMARKS        Only tested with 2-dimensional array 
;; 
;;RETURNS        Index of matched element or -1 if not found. 
;; 
;;DEPENDENCIES   none 
;; 
;;EXAMPLES       ; searching for partial match on rightmost dim on 3 dim array 
;;               mAscan($myArray, "windows XP", "1 2 0", 3, 1) 
;	 
;Source: 
Function mAscan($_Arr, $_Exp, $_StartAt, $_DimensionToScan, OPTIONAL $_Flags)
 
  Dim $_
  Dim $_C
  Dim $_Cache[ubound($arr,$dimensionToScan)]	; 
 
  $_StartAt = Split($_StartAt)
 
  For $_C = 0 to UBound($_Arr, $_DimensionToScan)
    $_StartAt[$_DimensionToScan - 1] = $_C 
    $_ = Execute("$$_Cache[$$_C] = $$_Arr[" + Join($_StartAt, ",") + "]")
  Next
  $mAscan = AScan($_Cache, $_Exp, , , $_Flags)
 
  Exit 0
 
Endfunction