Version 3 of scan

Updated 2002-01-24 23:29:25

http://www.purl.org/tcl/home/man/tcl8.4/TclCmd/scan.htm


display and numeric format for ASCII characters. display and numeric format for ASCII characters. Scan provides the usual answer:

    foreach character {a A b B c} {
        scan $character %c numeric
        puts "ASCII character '$numeric' displays as '$character'."
    }

    ASCII character '97' displays as 'a'.
    ASCII character '65' displays as 'A'.
    ASCII character '98' displays as 'b'.
    ASCII character '66' displays as 'B'.
    ASCII character '99' displays as 'c'.        

Also see "Dump a file in hex and ASCII", as well as "u2x" in the "Bag of algorithms".

Effect on the Internal Representation of a Value


Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command