Page 1 of 1

ASCII Byte Value from Single String Variable

Posted: Mon Apr 24, 2017 1:16 pm
by bernoulli
Is there a command which places the ASCII value of a one length string variable to a byte variable?

For clarity:
StringVariable[1] = "A"
ByteVariable = SomeCommand(StringVariable)

Re: ASCII Byte Value from Single String Variable

Posted: Mon Apr 24, 2017 1:22 pm
by Benj
Hello

You can just use the string as an array of bytes.

So for example you can do this.

StrVar = "Hello World"
ByteVar = StrVar[6]

ByteVar then should equal 'W'

This topic might help with some advanced string manipulation techniques.
viewtopic.php?f=63&t=17975&p=76223#p76223

Re: ASCII Byte Value from Single String Variable

Posted: Mon Apr 24, 2017 5:57 pm
by bernoulli
Thank you, Benj !