> >>>>> Pranab Bhowmick writes:
>
> Pranab> Hi, I am looking for a Tcl command which could convert integer
> Pranab> values to binary/hexadecimal and vice versa. I guess the
> Pranab> standard Tcl command set doesn't have such utility.
>
> Depends on the Tcl version: Tcl 8.0 has a binary command that allows
> to do quite a number of conversions. (Tcl 8.0 is also able to handle
> binary data in variables - at least with a subset of the command set.)
>
If Pranab meant base16 and base2 representation of integer rather than base10
he could just use normal scan and format tcl commands except that there is only
a format available for base8/10/16 (%o,%d,%x/X) and nothing for 2 (why!)...
Francois
'
-- * * * mailto:Francois.Junique@jet.uk Network Co-ordinator * Joint * ext: 4463 blp: 1826 Computer Group * European* http://www.jet.uk CODAS division (J2/A13) * Torus * JET Joint Undertaking Tel:+44 (01235) 46 4463 * * * ABINGDON, OX14 3EA, GB Fax:+44 (01235) 46 4404
-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.