Link to home
Start Free TrialLog in
Avatar of elschott
elschott

asked on

Assign result to variable variable name

Hello

I have looping structure where depending on the iteration of the loop will effect what variuable I assign the result to. For example loop iteration 1 assign result to string1 where string is common in all variable names and the numeric portion is variable. In iteration2 of the loop I want to assign the results to string2 and so on until the looping process is complete is there an easy way to do the variable assignment in one statement as opposed to do something like this

select case loopcount
  case 1 string1 = midstr(lineoftext, startpos, endpos)
  case 2 string2 = midstr(lineoftext. startpos, endpos)

etc..
startpos and endpos are controlled within the loop to return different parts of the string depending on where I am upto in the string.

Any suggestions?
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
P.S.

Dictionary can be found under the System.Collections.Generic namespace.