dcsimg
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: Intermediate
Jan 30, 2001

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Use Early Binding to Speed Up Procedure Calls


Use early binding by declaring variables as the correct object/interface. This will speed up procedure calls. Example:
  
 * Create a new Standard EXE Project 
 * Add a list box to Form1 
 * Add two command buttons to Form1 
 * Add the following lines of code to Form1: 
        Public Sub Test() 
        End Sub 
        Private Sub Command1_Click() 
        Dim StartTime As Single 
        Dim Index As Long 
        Dim var1 As Object 
        Dim var2 As Form 
        Dim var3 As Form1 
    
            Set var1 = Me 
    
            StartTime = Timer 
            For Index = 1 To 100000 
                var1.Test 
            Next 
            List1.AddItem 
Andreas Hillqvist
 
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