IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB Classic
Search VB Classic Group:

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

September Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB ClassicOOP   Print This     
 
VB Classic OOP:
VB Classic Destructor
 
Posted 15 years ago on 1/18/2009
VB Classic Code Snippet:
 A flashcard from our VB Classic Flashcards Library
 A code snippet from our VB Classic Code Snippets Page

KB101833

General Info: Class Destructor

A special class method called when an object instance of a class is destroyed. With some languages they are called when the object instance goes out of scope, with some languages you specifically have to call the destructor in code to destroy the object, and others use a garbage collector to dispose of object instances at specific times.

Desctructors are commonly used to free the object instance but with languages that have a garbage collector object instances are disposed of when appropriate. Either way, destructors or their equivalent are commonly used to free up resources allocated in the class constructor.

Languages Focus: Destructor

Are object instances freed with a garbage collector? Or, do you have to destroy object instances.

VB Classic Destructor

When an object instance is destroyed, VB6 calls a special parameter-less sub named Class_Terminate. For example, when the variable falls out of scope. Since you cannot specify parameters for this sub, you also cannot overload it.

To explicitly destroy an object, use Set YourClass = nothing.

When an object instance is created from a class, VB6 calls a special sub called Class_Initialize.

More Info

Definition:  Class Destructor

Comments

1 Comments.
Share a thought or comment...
Comment 1 of 2

Find the crease on the transmitter‘s case and pry it open with a clay blade if your transmitter is in a bad way shut at dissertation writing, you‘ll need a screwdriver to open it.

Posted 48 months ago

Comment 2 of 2

Thanks for sharing this type of interesting information. I have bookmarked it to read again. When you order an essay on the web, you hope to get the substance of top quality right on time, yet you likely would prefer not to spend your month-to-month spending plan on it. If you need help with writing essays, please check https://essayswriters.com/essays/Analysis/negative-effects-of-science-and-technology.html  papers - it is a good opportunity to find out new information and do your task faster and more quality. 

Posted 42 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P177A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Advanced

1 Advanced Level Question

Question #1: Multiple Choice

In VB Classic object oriented programming, when an object instance is destroyed, VB calls a special parameter-less sub named what?

Answer:
1. 

Finalize

2. 

Object_Terminate

3. 

Class_Terminate

4. 

Class_Finalize

5. 

Free


 KB Article #101833 Counter
11440
Since 1/18/2009
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2024 Prestwood IT Solutions.   [Security & Privacy]