I don't think concatenation is a good approach here. However, regardless of the solution, you'll have to have some way of connecting a control's "ID" to the value it should be displaying. I'm not sure how you're doing that today.
For example, in your above code, how do you know (in your code) that control 12
needs to have the value of 1,000
? Assuming you already have that handled, I think a far better solution (than concatenation) would be to simply store the control references in an appropriate collection (Array
or Dictionary
) with your internal reference as a key to the item.
So, in your above example, that could be something like:
var control_collection = {12: $ComponentDisplay/Component12Button}
Then, you could simply do something like this:
control_collection[12].text = "1,000"