Click here to Skip to main content
15,885,244 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Trying to merge exel print jobs Pin
Dave Kreskowiak21-Jun-12 4:04
mveDave Kreskowiak21-Jun-12 4:04 
GeneralRe: Trying to merge exel print jobs Pin
Nick Otten21-Jun-12 4:25
Nick Otten21-Jun-12 4:25 
GeneralRe: Trying to merge exel print jobs Pin
Dave Kreskowiak21-Jun-12 5:18
mveDave Kreskowiak21-Jun-12 5:18 
GeneralRe: Trying to merge exel print jobs Pin
Nick Otten21-Jun-12 21:26
Nick Otten21-Jun-12 21:26 
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 
I'm stumped.

I tried translating a class in c# to vb, and I'm stuck on this function.

For some reason, it's not looping around enough, to get the desired result.

So the input array is 0 0 6 089 0 0 12 176
and the output of converted is suppose to be "0000000000000000000001100101100100000000000000000000110010110010"

but I get 000000000000

Private Function ByteArrayToBitString(ByVal byteArray() As Byte) As String

        Dim idx As Integer = 0
        Dim jdx As Integer = 0
        Dim newByteArray() As Byte = New Byte(byteArray.Length - 1) {}

        Array.Copy(byteArray, newByteArray, byteArray.Length - 1)
        Dim converted As String = ""

        For idx = 0 To newByteArray.Length - 1
            For jdx = 0 To 7
                converted += If((newByteArray(idx) And &H80) > 0, "1", "0")
                newByteArray(idx) <<= 1
                jdx += 1
            Next
            idx += 1
        Next

        Return converted

    End Function


I took out the code, to test the loop counts, and it comes up short on jdx, and the idx loops around 8 times.

I must of made a stupid mistake somewhere, but I can't figure where. Just looking for other eyes on the code, because I don't see it, perhaps my translation is wrong somewhere, but you should be able to get the idea.
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 
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 

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.