Last post Jan 28, 2013 10:46 PM by innological
Jan 28, 2013 09:07 PM|wavemaster|LINK
I have the result from a QuerySingle in var row.
row has the count of occurences of variables is1 through iscount. Not sure how to explain this but let's say the count is 3, then there are entries in row, row, and row.
I would like to assign these to variables is1, is2 and is3 in a for loop
for (int i =2; i<count; i++)
is@i = row.[i];
I know is@i is not right, can someone tell me how to assemble a variable name from utilizing the i from the for loop?
This is what I am after:
var count = row4.Count;
var is1 = "I-" + row4.IS1;
var is2 = "I-" + row4.IS2;
var is3 = "I-" + row4.IS3;
var is4 = "I-" + row4.IS4;
var is5 = "I-" + row4.IS5;
var is6 = "I-" + row4.IS6;
var is7 = "I-" + row4.IS7;
all the way to is33
Jan 28, 2013 10:46 PM|innological|LINK
You cannot do it C#. You can use Dictionary<string, int> for that purpose or simply List<int> to store the counts.