c**v 发帖数: 103 | 1 【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: cctv (No Perfect Solution), 信区: Programming
标 题: Re: Tcl question
发信站: Unknown Space - 未名空间 (Mon Jan 5 21:34:48 2004) WWW-POST
How come Tcl's scan supports Octal but not binary? Or maybe I didn't make my
questin clear.
The following script will convert 0010 (in Octal) to 8 (in decimal)
% set vector 0010
% scan $vector %o value
>1
% puts $value
>8
Is there simple way to convert vector (like 0101) to decimal (5)? |
|