um....question is, what is LBound and UBound for in a winsock controL???? i need an answer quick...cause i want to finish up my program and i want to know if i left anything out that i could add in:)
Printable View
um....question is, what is LBound and UBound for in a winsock controL???? i need an answer quick...cause i want to finish up my program and i want to know if i left anything out that i could add in:)
They reutrn the Ubound and Lbound of a winsock control array .
[]P
yah....but what is LBound and UBound then??
Every time you do a load on the winsock control, it loads another winsock control with the same name. This increase the number of winsock controls in that array. The lbound tells you what is starts at (almost always 0) and ubound tells you the top one, which depends on how many you have loaded.
LBound returns the lower bound (smallest index number) of an array, and UBound returns the upper bound (largest index) of an array.
If you have an array like this: MyArray(0 To 22), then LBound will return 0 and UBound will return 22. The number of elements in your array is UBound - LBound + 1, or 23.
Example from MSDN:
UBound
The values from these functions are helpful when you are looping through an array of items and are unsure of what the starting and ending indexes are. For example:
Hope that helps...Code:Dim nCounter as Integer
For nCounter = LBound(GlobalArray) To UBound(GlobalArray)
Debug.Pring GlobalArray(nCounter)
Next ' nCounter
[Edited by seaweed on 11-08-2000 at 08:18 PM]