D
Dom
This is a little tricky, but I think the error I'm getting isn't
valid. The compiler just doesn't know my logic.
MyObject o;
switch (IntVariable)
{
case 1:
o = new MyObject()
break;
case 2:
o.MySetting = "Test Setting"
break;
}
The compiler tells me that I can use o.MySetting because "o" is
unassigned. Apparently it doesn't understand that case 1 will always
come before case 2. Is there a way to set things straight?
Dom
valid. The compiler just doesn't know my logic.
MyObject o;
switch (IntVariable)
{
case 1:
o = new MyObject()
break;
case 2:
o.MySetting = "Test Setting"
break;
}
The compiler tells me that I can use o.MySetting because "o" is
unassigned. Apparently it doesn't understand that case 1 will always
come before case 2. Is there a way to set things straight?
Dom