Dim UDPSocket1 As UDPSocket
End Sub
Sub Service_Create
UDPSocket1.Initialize("UDP", 5000, 8192)
Dim server2 As ServerSocket
End Sub
Sub Service_Start (StartingIntent As Intent)
End Sub
Sub Service_Destroy
End Sub
Sub UDP_PacketArrived (Packet As UDPPacket)
Dim msgudp As String
msgudp=""
msgudp = BytesToString(Packet.data,0, 4,"UTF8")
CallSubDelayed2(Main, "receiveudp", Packet.data)
End Sub
Dim msgudp As String
msgudp=""
msgudp = BytesToString(Packet.data,0, 4,"UTF8")
Dim msgudp As String = BytesToString(Packet.data,0, 4,"UTF8")
Dim msgudp As String = BytesToString(Packet.Data, Packet.Offset, Packet.Length, "UTF8")
filles with 0-bytes after the containing string?Lenght of string is 8192
Assuming that it is indeed a fixed-length string padded with NULs (ie ASCII 0x00), thenI have string where I have this: 123x456�������������������������������������
How to replace please � as "" (nothing)
Best regards
p4ppc
Dim msg2 As String
msg2 = BytesToString(Result, 0, Result.Length, "UTF8").Replace(Chr(0), "")
Dim msg2 As String
msg2 = BytesToString(Result, 0, Result.Length, "UTF8")
Log("Last character is Chr(" & Asc(msg2.CharAt(msg2.Length - 1)) & ")")
Log("Last byte is " & Result(Result.Length - 1))
Absolute 100 percent?!? Nothing warms my heart more than a bit of unbridled optimism.it's absolute 100 percent OK