Beja Expert Licensed User Longtime User Sep 4, 2020 #1 In VB it's in several lines.. VB code: B4X: Private Sub Command1_Click() Dim a(0 To 7) As Byte a(0) = "83" a(1) = "68" a(2) = "82" a(3) = "127" a(4) = "127" a(5) = "0" a(6) = "0" a(7) = "254" MSComm1.Output = a Thanks in advance Edit: It will be sent from Android device by Bluetooth. Last edited: Sep 4, 2020
In VB it's in several lines.. VB code: B4X: Private Sub Command1_Click() Dim a(0 To 7) As Byte a(0) = "83" a(1) = "68" a(2) = "82" a(3) = "127" a(4) = "127" a(5) = "0" a(6) = "0" a(7) = "254" MSComm1.Output = a Thanks in advance Edit: It will be sent from Android device by Bluetooth.
JohnC Expert Licensed User Longtime User Sep 4, 2020 #2 Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Then when you read a value, convert to byte. There might be a way to setup the array as a byte array directly, but I can't think of right now. Upvote 0
Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Then when you read a value, convert to byte. There might be a way to setup the array as a byte array directly, but I can't think of right now.
Beja Expert Licensed User Longtime User Sep 4, 2020 #3 JohnC said: Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Then when you read a value, convert to byte. There might be a way to setup the array as a byte array directly, but I can't think of right now. Click to expand... Thanks John This code is not working: I just stepped our and will be back soon. B4X: Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Stream.Write(Array) Any meaning? Upvote 0
JohnC said: Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Then when you read a value, convert to byte. There might be a way to setup the array as a byte array directly, but I can't think of right now. Click to expand... Thanks John This code is not working: I just stepped our and will be back soon. B4X: Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Stream.Write(Array) Any meaning?
LucaMs Expert Licensed User Longtime User Sep 4, 2020 #4 JohnC said: Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Click to expand... JohnC said: There might be a way to setup the array as a byte array directly, but I can't think of right now. Click to expand... ? Dim arrBytes() As Byte = Array As Byte(83, 68, 82, 127, 127, 0, 0, 254) You cannot use Array as variable name, it is a language keyword, of course. Upvote 0
JohnC said: Dim Array() As String = Array As String(83, 68, 82, 127, 127, 0, 0, 254) Click to expand... JohnC said: There might be a way to setup the array as a byte array directly, but I can't think of right now. Click to expand... ? Dim arrBytes() As Byte = Array As Byte(83, 68, 82, 127, 127, 0, 0, 254) You cannot use Array as variable name, it is a language keyword, of course.
Erel B4X founder Staff member Licensed User Longtime User Sep 6, 2020 #5 I will repeat Luca answer as it is really simple: B4X: Dim a() As Byte = Array As Byte (83, 68, 82, 127, 127, 0, 0, 254) Upvote 0
I will repeat Luca answer as it is really simple: B4X: Dim a() As Byte = Array As Byte (83, 68, 82, 127, 127, 0, 0, 254)