Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Mar 3, 2003

Skip Object Declaration Using "With" Keyword


If you want to use an object in the middle of a routine and avoid declaring the object in the routine, simply use this syntax:
 
With New  <object classname>
	.<method/property>
End With

This is the equivalent of:
 
Dim X as New <object classname>
With X
	.<method/property>
End With
Set X = nothing
Kevin Alons
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date