somewhat in my defense I look at anything in "" to be a literal string, but ya :-)
toggle quoted message
Show quoted text
--- In Crestron@..., "Steve Kaudle" <skaudle@...> wrote:
\x03\xE7 isn't eight characters, its two, the \x is an identifier that says
'the next two characters = one byte'
From: Crestron@... [mailto:Crestron@...] On Behalf
Of matt_rasmussen_2000
Sent: Wednesday, June 05, 2013 3:02 PM
To: Crestron@...
Subject: [Crestron] Re: Simpl+ hex manipulation
ITOHEX(999) = "3E7" do you really need that to be "\x03\x07" (8 characters)?
--- In Crestron@... <mailto:Crestron%40yahoogroups.com> ,
"prunier514" <jprunier@> wrote:
It's not worling like i want.
because the result is string = 999 in ASCII but it is string =
\x39\x39\x39 in hex...i want string = \x03\xE7
Finally i found a solution, like this:
integer i=atoi(x$) ----- i=999d/03E7h
integer hi= i/256
integer lo= i MOD 256
string = chr(hi)+chr(lo)
Working good!
--- In Crestron@... <mailto:Crestron%40yahoogroups.com> ,
"matt_rasmussen_2000" <mjrtoo@> wrote:
x$ = 03E7
val = HEXTOI(x$)
x = 999
string = ITOHEX(x)
That works right?
--- In Crestron@... <mailto:Crestron%40yahoogroups.com> ,
"prunier514" <jerome.homeprog@> wrote:
Hi guys,
First,I have a string. For example: string stringtest = "\x03\xE7";
Finally: I want take the both hex value of stringtest to put together
(so, I want 03E7)and convert this value in an integer to have 999 at the
end.
Any suggestions?
Thx for time