What is Early Binding and Late Binding? Can someone give me an analogy or example?
Thanks
Printable View
What is Early Binding and Late Binding? Can someone give me an analogy or example?
Thanks
Yeah, It's quite simple but I've never seen it written down anywhere.
when you Declare a variable you assign a block of memory to hold that variables value. eg
Dim x As Long
Allocated 4 bytes of memory to hold a long integer.
The program can either allocate this at compile time, or at runtime. if you declare it like that then it's allocated at compile time, which means it's faster to access
Dim x
or
Dim x as Variant
are Late Binding, VB Can't tell how much memory the variables are going to take up, so It has to allocate it at runtime, this is slightly slower.
as a rule of thumb Variants and strings are late binding, other variables are early binding, Objects are a bit of both.
Check Microsoft site:
http://support.microsoft.com/support.../Q245/1/15.ASP