How do you declare a 2d array? - Page 2 - AutoIt General Help and Support - AutoIt Forums
31 janvier 2025 à 16:06
Both Arrays and Maps use similar syntax, so care is required to ensure the variable is of the correct datatype - this is determined by the first declaration line for the variable:
Using empty [ ] declares a Map:
Local $vVar[] ; A Map
Filling the [ ] with a dimension size declares an Array:
Local $vVar[3] ; An Array
Assigning element values when declaring makes the variable an Array - these three lines are functionally equivalent:
Local $vVar[3] = [1, 2, 3] ; An Array
Local $vVar[] = [1, 2, 3] ; An Array
Local $vVar = [1, 2, 3] ; An Array
— Direct link