Parameter in component name

I am making a screen with a LOT of CL using various components such as Graph1, Table1, etc. Then I want to duplicate the screen and, in the new version, change the component names to Graph2, Table2, etc. The problem is that I also have to go through all the lines of CL code and update each reference to a component so it’s referencing the “2” version of the component.

Is it possible to define a variable at the start of my code, like “ScreenNumber”, and then reference components using that variable instead of using their actual names?

For example, if I’m on Screen 4, I would try this:

ScreenNumber = 4
CurrentTable = “Table${ScreenNumber}”
x1 = CurrentTable.cellContents(1, 1)

and then the CL would reference Table4?

It’s possible to refer to another component, like CurrentTable = table4, and then use CurrentTable everywhere in the script. Does that help?

Yes, that’s an 85% solution. Thank you.