I have a namespace with a class inside it with another class inside that, i.e.
namespace MySpace
public class MainClass
public class SubClass
public x as integer
public z as integer
end class
public function Foo ()
dim y as SubClass
y.x = 5
return
end function
end class
end namespace
except the line y.x = 5 gets underlined with the tip "Variable y is used before it has been assigned a value. A null exception could result at runtime"
Basically I want to be able to have the multiple items that Foo assigns then available to whatever other code is using the MainClass class. What is the safest way to do this? If I was doing this in C I would have used a struct but apparently they are less efficient in VB?