Updating form row from function

Updating form row from function

Hi,
I'm updating a row on user input, e.g.
On User Input:
row.Value = row.AnotherValue * 2;
What I need is to pass this row to a function because I need to duplicate this same block multiple times on different events, but inside the function the row can't be updated
Thanks