# Function Reference

# _Array2DCreate

Construct an 2D array from two 1D or 2D arrays

#include <Array.au3>
_Array2DCreate ( $aArray1, $aArray2 )

## Parameters

$aArray1 | A 1D or 2D Array
$aArray2 | A 1D or 2D Array

## Return Value

Success: | An 2D array.
Failure: | Set @error Flag.
@error: | 1 if either parameter is not a 1D or 2D array. 2 the 1D or 2D arrays are not the same row size. 3 if either parameter is not an array.

## Remarks

The construction is valid for 1D + 1D, 1D + 2D, 2D + 1D or 2D + 2D (See Example #2)

## Example

### Example 1

    #include <Array.au3>

    Local $oDi = ObjCreate('scripting.dictionary')
    For $i = 0 To 10
        $oDi.Add('key' & $i, 'item' & $i)
    Next

    _ArrayDisplay(_Array2DCreate($oDi.Keys, $oDi.Items))

### Example 2 _Array2DCreate() with 1D or 2D arrays

    #include <Array.au3>

    Local $aArray3

    Local $aArray1 = [10, 11, 12]
    Local $aArray2 = [20, 21, 22]
    $aArray3 = _Array2DCreate($aArray1, $aArray2)
    If @error Then Exit MsgBox(0, "_Array2DCreate 1D + 1D", "error " & @error)
    _ArrayDisplay($aArray3, "1D + 1D")

    Local $aArray1 = [10, 11, 12]
    Local $aArray2 = [[20, 23], [21, 24], [22, 25]]
    $aArray3 = _Array2DCreate($aArray1, $aArray2)
    If @error Then Exit MsgBox(0, "_Array2DCreate 1D + 2D", "error " & @error)
    _ArrayDisplay($aArray3, "1D + 2D")

    Local $aArray1 = [[10, 13], [11, 14], [12, 15]]
    Local $aArray2 = [20, 21, 22]
    $aArray3 = _Array2DCreate($aArray1, $aArray2)
    If @error Then Exit MsgBox(0, "_Array2DCreate 2D + 1D", "error " & @error)
    _ArrayDisplay($aArray3, "2D + 1D")
    Local $aArray1 = [[10, 13], [11, 14], [12, 15]]
    Local $aArray2 = [[20, 23], [21, 24], [22, 25]]
    $aArray3 = _Array2DCreate($aArray1, $aArray2)
    If @error Then Exit MsgBox(0, "_Array2DCreate 2D + 2D", "error " & @error)
    _ArrayDisplay($aArray3, "2D + 2D")

    Local $oDi = ObjCreate('scripting.dictionary')
    For $i = 0 To 10
        $oDi.Add('key' & $i, 'item' & $i)
    Next

    $aArray3 = _Array2DCreate($oDi.Keys, $oDi.Items)
    If @error Then Exit MsgBox(0, "_Array2DCreate object 1D + 1D", "error " & @error)
    _ArrayDisplay($aArray3, "object 1D + 1D", "", 0, Default, Default, -90)