Forum Discussion
belltown
11 years agoRoku Guru
That code will run, although 'doit' will always be Invalid since a Sub never returns anything.
Other than that your assertion is correct. When you store a reference to a function in an associative array or an array or in any other variable, you are doing just that, storing a reference to the function (its address if you like). Any time you have a function or a reference to a function stored in a variable, you invoke the function by using the function call operator (), which executes the function passing in any parameters enclosed within the parentheses and returns the result from any Return statement.
Other than that your assertion is correct. When you store a reference to a function in an associative array or an array or in any other variable, you are doing just that, storing a reference to the function (its address if you like). Any time you have a function or a reference to a function stored in a variable, you invoke the function by using the function call operator (), which executes the function passing in any parameters enclosed within the parentheses and returns the result from any Return statement.