|
-
Jul 31st, 2000, 02:03 AM
#1
Thread Starter
Addicted Member
hi there,
Shifting bits - is it possible on VB ?
cause i execut the API GetLogicalDrivers that return value is a bitmask representing the currently available disk drives. Bit position 0 (the least-significant bit) is drive A, bit position 1 is drive B, bit position 2 is drive C, and so on.
i want to know which 1 of the bits is "on" and which 1 is "off" , and the only way i know is by shifting bits.
my questions are :
1. is it possible shifting bits on VB
2. if not , how can i get all the logical drivers.
thanks ,
lirlir
The MORE I get to know,
I realize that I know NOTHING !
-
Jul 31st, 2000, 03:12 AM
#2
Frenzied Member
I am not aware of a VB bitshift command but you could just divide by 2 to shift right.
Code:
Option Explicit
Dim a As Byte
Private Sub Command1_Click()
a = a / &H2
Debug.Print a
If a And &H1 Then
Debug.Print "bit 1 is set"
Else
Debug.Print "bit 1 is clear"
End If
End Sub
Private Sub Form_Load()
a = &H8
Debug.Print a
End Sub
-
Jul 31st, 2000, 03:34 AM
#3
Thread Starter
Addicted Member
thanks mate
that 1 i know,
but thanks any way
lirlir
The MORE I get to know,
I realize that I know NOTHING !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|