Jump to content
  • Advertisement
Sign in to follow this  
Cazzikk

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

This topic is 2908 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!