How can a STRING be converted to it's individual BYTES

Status
Not open for further replies.

camerart

Well-Known Member
Hi,
I would like to convert a STRING to it's 2x BYTES, how is this done please?
Camerart
 
Example please? Vlad offers several ways of doing this...
The string is only a byte array... so you can do this

mystring = "Hello"
a = mystring(1)
b = mystring(2)

a will equal 'e' and b will equal 'l'
 
Example please? Vlad offers several ways of doing this...
The string is only a byte array... so you can do this

mystring = "Hello"
a = mystring(1)
b = mystring(2)

a will equal 'e' and b will equal 'l'
Hi I,
When I asked the question I was sending a STRING STRQEIDEG, which is a WORD via SPI, where we were having trouble, decoding at the other end.
After a lot of tries we tried splitting the STRING into it's 2x BYTEs using 'QEIDEG =StrValW(strqeideg)' (following your example of reading the D/S ) and SENT 2x separate BYTES. (W = WORD VALUE)
This works.
Thanks, C.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…