Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
I faced this strange behavior when i was coding. so i ask it here What is the Scope of for loop when declaring variables? This means both are not in same scope. But this code does not compile. This means the in middle of loops has the same scope of first loop and the second loop. But how can in two for loops have different scope but the same scope with middle . because currently i see them in same level. I know the second code does not compile.
It depends on what you're looking for. If you need to set the variables in a single line, that won't work. You could play with reflection if you're dealing with fields or properties, but honestly that seems messier than what you've got already. If the data-structure doesn't matter, and you just need the data and are able to play with it as you see so fit, I'd probably enumerate it into a dictionary.
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.