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

How to use "Function with Array parameter"

$
0
0
Hello Community,

I use AutoIT quite a while now and somehow I seem to be mentally blocked :ermm:
I am facing the following problem:

I have 2 script files:
  • test1
  • test2
Test2 contains the function definition as follows:

"Func PaketInstaller($InstSprache, $LogFileHandle, $Software, $Pfad, $WinVersion, $Architektur)"
  • $InstSprache, $Pfad, $WinVersion, $Architektur= String
  • $LogFileHandle = Handle to a txt file
  • $Software = Array[8]
Test1:
From the script in test1 I want to call the function which is defined in test2.
The big problem which I am confronted with is transmitting the array "$Software" successfully without getting an array fault with the following code:

Local $avPakete[8] = [0,0,0,0,0,0,0,0]



$avPakete[0] = GUICtrlRead($cbx_1)

$avPakete[1] = GUICtrlRead($cbx_2)

$avPakete[2] = GUICtrlRead($cbx_3)

$avPakete[3] = GUICtrlRead($cbx_4)

$avPakete[4] = GUICtrlRead($cbx_5)

$avPakete[5] = GUICtrlRead($cbx_6)

$avPakete[6] = GUICtrlRead($cbx_7)

$avPakete[7] = GUICtrlRead($cbx_8)


PaketInstaller($SelSprache, $file, $avPakete, $InstPfad, $win, $arc)


When I call my function I always get the following error:

"Error Subscript used with non-Array variable"

Can somebody please help me how to use / define a function in AutoIT with an array as a parameter!?
Somehow I am not that experienced with Basic but with other languages I would have solved it easily but here I am totally mentally blocked at the moment :(

Many thanks in advance!

Greetings

Toco1982

Viewing all articles
Browse latest Browse all 12506

Trending Articles



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