Terry said:
Is there a way to find a class level variable dynamically? I'm trying to
load about 25 variables at startup and it would be nice to find a
variable by its name so I don't have 25 lines of myVar = thisValue.
Yes, it might be possible, but I don't think that it's practical. With
proper error handling you will most likely end up with pretty much the
same amount of code anyway.
If it would be possible to do with less code than 25 lines, that means
that your variable names has to follow a pattern. In that case, I wonder
if they should not be separate variables in the first place. Have you
considered using an array or a Dictionary?