Hi,

I have a script where I make separate routines with identical code

Example:
Code:
sub AddToA {
ATotal += 1
}

sub AddToB {
BTotal += 1
}
What I would like to do is have 1 routine and dynamically set the variable I'm adding to
Similar to:
Code:
sub AddOneToTotal {
(A/B)Total += 1
}
Essentialy the (A/B) in the 2nd block is a variable that I set in another function.

Any pointers would be appreciated.