Lets assume I have a block of code, this block of code accesses many variables, (lets say 20 just to keep the number high)
This block of code needs to be run 10 times with 10 different sets of variables. so each of the 20 variables has a number defining its set. For example:
Variable1_1
Variable2_1
Variable3_1
...
Variable1_2
Variable2_2
...
Is it better to copy the block of code 10 times and manually correct the variable names in each block, or is it better to make a function and pass all variables? How can i know what is better to do? is there a limit for the number of variables to pass in a function?
If it would be PHP i would use a variable in the variablename like $$variablename but in vb.net this is not supported.
Thanks!