How to replace Variable from Write/Set Function Dynamically?

How to replace Variable from Write/Set Function Dynamically?

Hi! As the title sais I want to know if there is a way to use the same function in diferent buttons to write on diferent varaibles. This is because I have a control array of 50 elements and I want to avoid using 50 functions that only changes the destination variable.

As an example:

I have a function that write the value 10 to a variable, 3 variables (varA,varB,varC) and 3 buttons. I want one button to execute the function to varA, other execute the same function on varB, and the last one the same function on varC.

-Thank!