Bolek
12-13-2004, 03:56 PM
Hello,
can somebody explain to me the
dim x as new y
set x = nothing
stuff, please? I am pretty skilled at C++. Is it similar to the new/delete operators? Or does this increase some reference counters and the memory is freed by garbage collector sometimes later as in Java?
How is it with the lifecycle of objects declared with dim x as new? If I declare a local variable this way, will it be freed when I leave the procedure or will it stay allocated until I explicitely delete it? And what with variables global to a form? Will they be freed when I unload the form? Adn if a class object is a member of another class, will it be freed if the parent object is freed automatically?
Thanks for your response. I was unable to find good explanation of this. In VB manuals they simply use this syntax without explaining these things. That's why I like C++ better - you have to know more but you better understand what your program is doing.
can somebody explain to me the
dim x as new y
set x = nothing
stuff, please? I am pretty skilled at C++. Is it similar to the new/delete operators? Or does this increase some reference counters and the memory is freed by garbage collector sometimes later as in Java?
How is it with the lifecycle of objects declared with dim x as new? If I declare a local variable this way, will it be freed when I leave the procedure or will it stay allocated until I explicitely delete it? And what with variables global to a form? Will they be freed when I unload the form? Adn if a class object is a member of another class, will it be freed if the parent object is freed automatically?
Thanks for your response. I was unable to find good explanation of this. In VB manuals they simply use this syntax without explaining these things. That's why I like C++ better - you have to know more but you better understand what your program is doing.