Sign in to follow this  

[VB.Net] setting an object to nothing and including references?

This topic is 2661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

class myclass
...
end class

module Globals
public myobjects(100) as myclass
end module

class form1
...
sub dostuff()
myobjects(5) = new myclass
? dim newobject as myclass = myobjects(5)
? newobject = nothing
? myobjects(5) = nothing
end sub

the 3 lines with ? are in question, when i declare a variable to reference the instance of myobjects(5), i can do most anything to change the data through either variable, but Nothing seems to only apply to the specific variable.

so how to have 1 time of Nothing, be carried to all locations referencing?
i know i can add a variable to myclass instead, deleted as boolean, but seems sloppy

Share this post


Link to post
Share on other sites

This topic is 2661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this