what does that fuction do in vb i see people use it alot and i dont know what it does thanks
Printable View
what does that fuction do in vb i see people use it alot and i dont know what it does thanks
It returns the length of a string
NO kedaman!
The Len function returns the length of a variable. Try this:
It will return 4. So, the Len function in VB returns the length (number of bytes) of a variable.Code:Dim a As Long
Debug.Print Len(a)
Actually, you're both right. The Len function will perform either of these options depending on what you pass through it.
No MegaTron -- I am right, keda is wrong.
What he says is that the Len funcion does not return the length of a Long, for instance. Whereas I say the Len function returns the length of a string and anything else, you pass it.
SO, I am right, hehe.
HaxSoft:
kedaman didn't say it didn't do anything...He said one of the things it does...and who cares about my daddy's bigger than your daddy junk. As long as Bob gets an understanding of what is happening and I am sure he can figure it out between the lines.
Len does actually returns the length of a string, if you compare to LenB that returns the length of the memory used by the string. So actually yes, were both right, + Megatron is right and not to forget HeSaidJoe is right.
so it can return a strinf value right lets say i ave a dim a string i can get the lenth of that string riht
Bob:
Yes, as stated above, it will return the length of a string if you pass it a string.
myString = "Bob"
myLen = len(myString) ' Return of 3