In my application I am using variables with names like dp1,dp2,....dp13 in order to use them in loops and I want to call thame in a for loop. I want to use it something like given below.
DataPoint dp1,dp2,dp3,dp4,dp5;
string s1,s2,s3,s4,s5;
for(int i=1;i<=5,i++)
{
GetVariable("dp"+i.ToString()).Add(val1, val2);
GetVariable("s"+i.ToString())="MyStringValue";
}
How can I do that ? I saw at some places ask me to use System.Reflection but I don't know how to use it as I want