Click here to Skip to main content
16,020,714 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Trying to merge exel print jobs Pin
Mycroft Holmes21-Jun-12 19:42
professionalMycroft Holmes21-Jun-12 19:42 
GeneralRe: Trying to merge exel print jobs Pin
Nick Otten21-Jun-12 21:32
Nick Otten21-Jun-12 21:32 
GeneralRe: Trying to merge exel print jobs Pin
Mycroft Holmes21-Jun-12 22:18
professionalMycroft Holmes21-Jun-12 22:18 
Questionbyte array to string Pin
jkirkerx20-Jun-12 18:06
professionaljkirkerx20-Jun-12 18:06 
SuggestionRe: byte array to string Pin
Sandeep Mewara20-Jun-12 19:36
mveSandeep Mewara20-Jun-12 19:36 
GeneralRe: byte array to string Pin
jkirkerx20-Jun-12 20:10
professionaljkirkerx20-Jun-12 20:10 
GeneralRe: byte array to string Pin
Sandeep Mewara21-Jun-12 19:17
mveSandeep Mewara21-Jun-12 19:17 
GeneralRe: byte array to string Pin
jkirkerx21-Jun-12 20:31
professionaljkirkerx21-Jun-12 20:31 
I'll give that a try Friday

For some reason, bits that is passed into the function, is 1 too long, in other words, the length is 1 bit bigger than it's suppose to be.

So I did a -2 on the length in the loop instead of -1, and the value is now correct. It's sloppy, just a band-aid, but overall in the end, the return value is correct.

I would like to fix it correctly, so let me give your fix a test in the morning.
Good job on isolating it down to that function, and thanks for helping me out Sandeep.

Private Function BitStringToInteger(ByVal bits As String) As Integer

        Dim converted As Integer = 0

        For i As Integer = 0 To bits.Length - 2 '<- chopped it down 1 more
            converted = (converted << 1) + If(bits(i) = "1", 1, 0)
        Next

        Return converted

    End Function

AnswerRe: byte array to string Pin
Nick Otten21-Jun-12 2:43
Nick Otten21-Jun-12 2:43 
QuestionPassword Storage Class Pin
flinchy318-Jun-12 4:31
flinchy318-Jun-12 4:31 
AnswerRe: Password Storage Class Pin
908236518-Jun-12 6:26
908236518-Jun-12 6:26 
GeneralRe: Password Storage Class Pin
flinchy318-Jun-12 7:28
flinchy318-Jun-12 7:28 
GeneralRe: Password Storage Class Pin
908236519-Jun-12 5:29
908236519-Jun-12 5:29 
GeneralRe: Password Storage Class Pin
flinchy321-Jun-12 4:17
flinchy321-Jun-12 4:17 
GeneralRe: Password Storage Class Pin
908236521-Jun-12 5:30
908236521-Jun-12 5:30 
GeneralRe: Password Storage Class Pin
908236522-Jun-12 10:39
908236522-Jun-12 10:39 
GeneralRe: Password Storage Class Pin
flinchy328-Jun-12 1:20
flinchy328-Jun-12 1:20 
GeneralRe: Password Storage Class Pin
flinchy328-Jun-12 1:25
flinchy328-Jun-12 1:25 
QuestionHow to get session state in VB.NET desktop app Pin
ilgrongo18-Jun-12 3:38
ilgrongo18-Jun-12 3:38 
AnswerRe: How to get session state in VB.NET desktop app Pin
Dave Kreskowiak18-Jun-12 10:53
mveDave Kreskowiak18-Jun-12 10:53 
GeneralRe: How to get session state in VB.NET desktop app Pin
ilgrongo18-Jun-12 13:04
ilgrongo18-Jun-12 13:04 
GeneralRe: How to get session state in VB.NET desktop app Pin
Dave Kreskowiak18-Jun-12 14:51
mveDave Kreskowiak18-Jun-12 14:51 
GeneralRe: How to get session state in VB.NET desktop app Pin
ilgrongo18-Jun-12 19:52
ilgrongo18-Jun-12 19:52 
QuestionWindows 7 Lock app Pin
flinchy316-Jun-12 2:42
flinchy316-Jun-12 2:42 
AnswerRe: Windows 7 Lock app Pin
Dave Kreskowiak16-Jun-12 3:42
mveDave Kreskowiak16-Jun-12 3:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.