Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. rosskettles

    converting integer to hex

    ok, quick question. Does anyone know how to use the skip over bytes binary scan function?
  2. rosskettles

    converting integer to hex

    Hi, I fixed the problem myself using: if {"[expr $byte==\$d]"} { spaces are very critical!!
  3. rosskettles

    converting integer to hex

    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.
  4. rosskettles

    converting integer to hex

    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...
  5. rosskettles

    converting integer to hex

    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]...

Part and Inventory Search

Back
Top