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 Classic (6 and earlier)
Expertise: Beginner
Nov 3, 2016

Sometimes you Don't Need a Variable

If you're going to use an object and get rid of it after a few lines, you don't need to declare a variable to it. Just use With. Here is an example:

With CreateObject("Scripting.FileSystemObject")
    FullPath = .BuildPath(Path, FileName)

    If Not .FileExists(FullPath) Then
        Rem Do something...
    End If
End With
Oracy
 
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