Click here to Skip to main content
15,915,163 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Best Way to handle foreign characters from XML to disk file Pin
QuickBooksDev3-May-07 2:59
QuickBooksDev3-May-07 2:59 
GeneralRe: Best Way to handle foreign characters from XML to disk file Pin
kubben3-May-07 3:40
kubben3-May-07 3:40 
GeneralRe: Best Way to handle foreign characters from XML to disk file Pin
QuickBooksDev3-May-07 3:58
QuickBooksDev3-May-07 3:58 
GeneralRe: Best Way to handle foreign characters from XML to disk file Pin
kubben3-May-07 4:34
kubben3-May-07 4:34 
GeneralRe: Best Way to handle foreign characters from XML to disk file Pin
QuickBooksDev3-May-07 4:35
QuickBooksDev3-May-07 4:35 
QuestionHow to convert a BitArray of length 8 into a single byte Pin
edmonson2-May-07 6:06
edmonson2-May-07 6:06 
AnswerRe: How to convert a BitArray of length 8 into a single byte Pin
Guffa2-May-07 6:24
Guffa2-May-07 6:24 
AnswerRe: How to convert a BitArray of length 8 into a single byte [modified] Pin
Dave Kreskowiak2-May-07 7:01
mveDave Kreskowiak2-May-07 7:01 
The BitArray class doesn't support conversions to other types (EDIT: I completely forgot about CopyTo!!).

If you're only using 8 bits, you're much better off just using a Byte and doing the bit manipulation yourself. It's easy to write your own methods to automate some of this, like setting or resetting a bit.

A quick little whip up:
Public Shared Function SetBit(ByVal value As Byte, ByVal position As Integer) As Byte
    If position < 1 Or position > 8 Then
        Throw New ArgumentOutOfRangeException("Position must be between 1 and 8.")
    End If
 
    Dim mask As Byte = CByte(2 ^ (position - 1))
    If Not value And mask Then
        value = value Or mask
    End If
    Return value
End Function




-- modified at 13:06 Wednesday 2nd May, 2007

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionOpen file directly Pin
Xmen Real 2-May-07 5:23
professional Xmen Real 2-May-07 5:23 
AnswerRe: Open file directly Pin
Dave Kreskowiak2-May-07 5:51
mveDave Kreskowiak2-May-07 5:51 
GeneralRe: Open file directly [modified] Pin
Xmen Real 2-May-07 17:29
professional Xmen Real 2-May-07 17:29 
GeneralRe: Open file directly Pin
Dave Kreskowiak3-May-07 13:23
mveDave Kreskowiak3-May-07 13:23 
GeneralRe: Open file directly Pin
Xmen Real 3-May-07 18:18
professional Xmen Real 3-May-07 18:18 
QuestionVB printing problem Pin
Rich Leyshon2-May-07 4:42
Rich Leyshon2-May-07 4:42 
AnswerRe: VB printing problem Pin
Dave Kreskowiak2-May-07 6:23
mveDave Kreskowiak2-May-07 6:23 
GeneralRe: VB printing problem Pin
Rich Leyshon2-May-07 7:29
Rich Leyshon2-May-07 7:29 
GeneralRe: VB printing problem Pin
Rich Leyshon2-May-07 7:53
Rich Leyshon2-May-07 7:53 
QuestionOnly one window in the taskbar Pin
Jats_4ru2-May-07 4:38
Jats_4ru2-May-07 4:38 
AnswerRe: Only one window in the taskbar Pin
Psycho-*Coder*-Extreme2-May-07 4:51
Psycho-*Coder*-Extreme2-May-07 4:51 
AnswerRe: Only one window in the taskbar Pin
Dave Kreskowiak2-May-07 4:52
mveDave Kreskowiak2-May-07 4:52 
AnswerRe: Only one window in the taskbar Pin
Rupesh Kumar Swami2-May-07 5:02
Rupesh Kumar Swami2-May-07 5:02 
QuestionHow to close an application completely Pin
nahitan2-May-07 3:58
nahitan2-May-07 3:58 
AnswerRe: How to close an application completely Pin
Dave Kreskowiak2-May-07 4:03
mveDave Kreskowiak2-May-07 4:03 
GeneralRe: How to close an application completely Pin
nahitan2-May-07 4:07
nahitan2-May-07 4:07 
GeneralRe: How to close an application completely Pin
Dave Kreskowiak2-May-07 4:47
mveDave Kreskowiak2-May-07 4:47 

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.