adsense


Showing posts with label ADVANCE VB SCRIPT CLASS EVENTS. Show all posts
Showing posts with label ADVANCE VB SCRIPT CLASS EVENTS. Show all posts

Monday, 9 November 2015

ADVANCE VB SCRIPT CLASS EVENTS PAGE 103

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button




ADVANCE VB SCRIPT CLASS EVENTS





Class Events 


There are two events that are automatically associated 
with every class by default. Class_Initialize and Class_Terminate. 
Class_Initialize is triggered whenever you instantiate 
an object based on the class. Class_Terminate event is 
fired when the object goes out of scope or when the object is set to Nothing. 
Example 
In the below example, we will make you understand how the events work in VBScript. 
'Instantation of the Object 
Set objectname = New classname  
    
Private Sub Class_Initialize(  ) 
 Initalization code goes here 
End Sub 
 
'When Object is Set to Nothing 
Private Sub Class_Terminate(  ) 
 Termination code goes here 
End Sub