Jump to content

Calling functions with GUICTRLSetOnEvent

Recommended Posts

Hey guys!

I'm trying to call a function which has an array as a parameter. Is there a way of calling it, and supplying the parameter by using GUICTRLSetOnEvent?

My program looks something like this:

Event1: filelistarray= call function f1

function f1: Get a file list, and add to array. then, return a value array1

Event2: call function f2 and supply filelistarray

Is there a way of doing it?

Thanks guys!

Link to comment
Share on other sites

I think what you want is...

GUICtrlSetOnEvent ($control, "func1")

Func func1 ()
    $fillist = _FileListToArray ("file")
    func2 ($fillist)

Func ($list)
    For $I = 1 to UBound $list
        ConsoleWrite (@CRLF & $list[$I])
Link to comment
Share on other sites

Hi Bert!

Thank you very much for your reply. However, the function that needs to have the array is not executed right after the array has been made (nor automatically). So, the array will need to 'wait' in memory until all the other parameters are set (these will affect how the final function will behave through global variables, and what-not).

Any ideas?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...