|
-
Oct 15th, 2004, 09:18 AM
#1
Thread Starter
Fanatic Member
late binding
Hi,
Could you please explain why and where late binding is used in .net with a few examples?
Thanks
-
Oct 15th, 2004, 09:37 AM
#2
Hi
Simply don't late bind!
Calls on objects causes late binding that require extra work at runtime. Operators on objects causes late binding.
VB Code:
dim o,o1,o2 as object
o = o1 + o2 '' late binding
Option Strict ON will catch late binding
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Nov 11th, 2004, 08:02 AM
#3
PowerPoster
Originally posted by Asgorath
Hi
Simply don't late bind!
Calls on objects causes late binding that require extra work at runtime. Operators on objects causes late binding.
VB Code:
dim o,o1,o2 as object
o = o1 + o2 '' late binding
Option Strict ON will catch late binding
Regards
Jorge
Hi,
I have the following function
[Highlight=VB]
Function standev(ByVal mean As Double, ByVal grades As Array) As Double
Dim x As Integer
Dim totaltop As Double = 0
For x = 0 To grades.Length - 1
totaltop = totaltop + (grades(x) - mean) * (grades(x) - mean)
Next
Return Math.Sqrt(totaltop / (grades.Length))
End Function
[vbcode
As you point out, with Option Strict On grades(x) is late binding.
However, if I cut and paste the entire sub code into a button_click event I have no problem.
Are you saying that it is the calling of the Sub which causes the problem? (Grades() is a form scope integer array).
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|