How to define a 2D array Topic is solved
Posted: 21 Oct 2019, 10:05
Hi,
I was trying to work with 2D arrays in AHK, as I wasn't able to find a simple newb-friendly post, here it is.
First define your matrix with the number of rows that you want, columns are not required as 2D is basically array of arrays.
Here I am using 6 rows, like this you can populate a 2D matrix.
Let me know if a similar post exists, I shall delete this in that case.
I was trying to work with 2D arrays in AHK, as I wasn't able to find a simple newb-friendly post, here it is.
Code: Select all
my_2D := [[1],[2],[3],[4],[5],[6]]
my_2D[1][1] := "a"
Here I am using 6 rows, like this you can populate a 2D matrix.
Let me know if a similar post exists, I shall delete this in that case.