Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Passing a part of a multidimensional array to a function

$
0
0
Hi,

I have a multidimensional array, and I want to use a part of it to pass it to a Func

Below is an example of what I want to do.

First I declare my array and fill it with values.
Then I use a For ... in ... Next to pass the two dimensional sub array to a function MyFunc
In the Function MyFunc I want to handle the parameters

[ autoit ]      
Dim $MultiArray[5][2] = [["String 1", 6], _              ["String 2", 7], _              ["String 3", 8], _              ["String 4", 9], _              ["String 5", 10]] For $SubArr in $MultiArray      MyFunc($SubArr) Next Exit Func MyFunc(ByRef $Arr)      ConsoleWrite($Arr[0] & " - " $Arr[1]) EndFunc

For me, this seemed a logic way to do this but AutoIt doesn't seem to follow my logic :-)
Is there a way to make this work?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>