Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

Cast variable or string as member function

Is there a way to use a variable, string, array key, etc., as a member function? Here's an example:

screen = CreateObject("roGridScreen")

' Assign the member function names to the array keys,
' and their respective values the array values.
gridAA = {
"SetDisplayMode": "scale-to-fill",
"SetGridStyle": "Flat-Movie"

' Issue is right here:
for each gridFunc in gridAA
gridVar = gridAA[gridFunc]

As it's written this code is interpreting screen.gridFunc(gridVar) literally (which obviously won't work), so is there a way to cast gridFunc(gridVar) as a member function so that it can be called by screen (which in this case is an roGridScreen object)?
0 Kudos