Hi, for incoming udp_packets, i start with a loop to seperate the content, for instance content: "ambient:1000:100:20:60:30:50:5:17:4". Want to seperate first word as 'order' with:
B4X:
Dim NOP As Byte ' Number of Points
Dim order() As Byte
For Each s() As Byte In bc.Split(Buffer, ":") 'count ":"
NOP = NOP + 1
If NOP = 1 Then
order = s
Log("order1 : ", order) ' here, 'order' is "ambient"
End If
Log(NOP," : ", bc.StringFromBytes(s))
Log("order2 : ", order) ' here, 'order' is "ambient" when NOP = 1
Next
Log("order3 : ", order) ' here, 'order' is "" - empty
B4R strings are different than in other B4X tools. The reasons for these differences are: 1. Very limited memory. 2. Lack of Unicode encoders. A String object in B4R is the same as C char* string. It is an array of bytes with an additional zero byte at the end. The requirement of the last zero...
B4R strings are different than in other B4X tools. The reasons for these differences are: 1. Very limited memory. 2. Lack of Unicode encoders. A String object in B4R is the same as C char* string. It is an array of bytes with an additional zero byte at the end. The requirement of the last zero...
Yes, thank you Erel. It's in line 4. Works fine now. Arraycopied s() to defined bytearrays and can send them to subroutines. Very transparent. Have a good time. Will there be a b4h for New Huawei OS? ?