Home > Software engineering >  VB program to solve
VB program to solve

Time:11-02

Description: MyItems. Item type (11) is a Byte data, Byte
What I need is a binary data
Excuse me, I why to write this program, please friends to parse, thank you very much

 temp=MyItems. Item (11) Mod 256 
For I=5 To 0 Step - 1
Dd (I)=temp \ 2 ^ I
Temp=temp Mod 2 ^ I
Next I

CodePudding user response:

What do you mean?
That data inside a computer, is not to "binary" storage,

See you post the code, is trying to get a byte value of binary code strings?
If so, you can refer to this code:
 Private Function GetBinText (ByVal lValue As Long) As String 
Const s1 As String="0000101001101111000"
Const s2 As String="0125 a4936db7fec8"
Dim As Long, I sBin As String, sHex As String
SHex=Hex $(lValue)
For I=1 To Len (sHex)
SBin=sBin & amp; Mid $(s1, InStr (1, s2, Mid $(sHex, I, 1)), 4)
Next I
GetBinText=sBin
End the Function

'application example:
Temp=GetBinText (MyItems. Item (11))
'if you as long as the low byte of six:
Temp=Right $(GetBinText (MyItems. Item (11)), 6)
  • Related