Android Question How to convert list to byte array

StarinschiAndrei

Active Member
Licensed User
Longtime User
Hello,
I would like to create programmatically the following command :
B4X:
aStream.Write(Array As Byte (2,Asc("?"),Asc("s"),Asc("t"),3,Asc("3"),Asc("5")))
how can i convert a list to byte array ? i try this :
B4X:
Dim cmdSecv As List
    Dim b() As Byte
    cmdSecv.Initialize
cmdSecv.Add(2)
cmdSecv.Add(Asc("?"))
cmdSecv.Add(Asc("s"))
cmdSecv.Add(Asc("t"))
cmdSecv.Add(3)
cmdSecv.Add(Asc("3"))
cmdSecv.Add(Asc("5"))
    Log(cmdSecv)
'aStream.Write(Array As Byte (2,Asc("?"),Asc("s"),Asc("t"),3,Asc("3"),Asc("5")))
'b=cmdSecv
aStream.Write(Array As Byte (cmdSecv))
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…