The question went away but I figured this still might be helpful for others…
Example of having a button call a function based on current array choice:
Sub makesound()
? "Making sound"
end Sub
array = []
arrayitem = { title:"sound", action:makesound}
array.Push(arrayitem)
if button=codes.BUTTON_SELECT_PRESSED
doit=array[0].action()
end if
The () should be left off the name of the function until it’s time to actually run the function
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.