You have indeed found a bug in the scan command. This occured
when 'scan' was rewritten for 8.1 to support unicode. The problem
is rather simple - it won't read past the "0x...", so you are
always scanning the 0 before the x. You can see this with:
scan 0x001 %xx%x
=> 0 1
The workaround is to do:
set a [expr $a]
and then the scan. This does need to be reported to SourceForge
as well. Is this something that you will also need corrected in
the IOS port?
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions
> -----Original Message-----
> From: Hemang Lavana [mailto:email@example.com]
> Sent: December 19, 2001 1:12 PM
> To: jeffH@ActiveState.com
> Cc: andreasK@ActiveState.com; firstname.lastname@example.org
> Subject: Bug in scan command?
> Hello Jeff,
> Is this a bug in scan command? I tried these commands in tcl126.96.36.199
> version on win2k and got the same results. Note that ATS3.2 contains
> tcl8.0.5 version and ATS3.4 contains tcl8.3.3 version.
> % package provide ActiveTcl
> (bin) 2 % set a 0x0001
> (bin) 3 % scan $a %x a
> (bin) 4 % puts $a
> (bin) 5 % scan 0xff %x
> Let me know if you want me to file a bug on SF.