Tried this:
if {"[$byte==\$d]"} {
set var2 [format %x $d]
puts "$var2"
So the if statement will physicaly check if $d ($byte) is equal to the string $d. But apparently this is an invalid command name "$d==$d".
hmm.
Thanks for the reply, I'm finding it hard to implement the code you've given me. The problem is with the variable 'byte' (not count) it returns the variable '$b' or whatever it happens to be (it's in a foreach loop) and not the actual value of '$b' which is what I need.
I also need to put...
Just a small problem in a program I'm doing. I need to write to a file in Hex. I have two integer values, which I want to write in the format; 0x[var1][var2] e.g 0xFF or 0xF1 et cetera.
The code I have tried so far is:
set var1 [format %x $count]
puts $out "var1"
set var2 [format %x $latest]...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.