Strings in VB?
Posted on 1997-11-17
I'm still having trouble understanding strings in VB 5.0. I think that I'm too used to processing strings as character arrays as in C/C++. Anyhow recently I asked the question "How do I convert a string of Integers to its' binary equivalent" Someone answered with a function that looked like this...
Public Function Long2Binary(ByVal lValue&) As String
sBinary = ""
For iBit = 0 to 14
lBitValue = 2 ^ iBit
sBinary = IIF((lValue And iBitValue, "1", "0")&sBinary
Long2Binary = sBinary
Well, I got the function to work by converting the string into a long & then passing that value into the function, but I still don't understand how the function manipulates each value...if you can explain and offer a suggestion as to how to reverse the process of this function...that it to convert a binary into an integer, it's worth another 300 pts.