squirreltown
11 years agoRoku Guru
array function prams
I have an array of aa's that are a part of a settings screen, 20 different buttons that do different things. I'm calling a function from each button. In the below Autopaint is a function being called.
Thanks
butts = []
button={title:"RUN DEMO" , action:AutoPaint, sec:"demo", } : butts.Push(button)
butts[index].action(varr, m )You can see, this way requires me to have the same function parameters for all the buttons. I can of course get around this in a clunky way using the button index, but I'm wondering if there is a slick way that allows me to put the function parameters in the array somehow?
Thanks