Help - Converting gets string to integer
Quote:
> If I get a string from a file using gets, is there an easy way to
> convert it to an integer? I could write a proc to do this, but
> there might be some built in function ..... ?
As they used to say: "Everything is a string" (it's slightly more
complicated these days under the hood). When your code needs an integer
(e.g. in expr or incr), it is automagically converted out of that
string. No need for explicit conversion, for decimals at least. For hex
strings, or getting the numeric value of a character, use scan.
--
Schoene Gruesse/best regards, Richard Suchenwirth - +49-7531-86 2703
RC DT2, Siemens Electrocom, Buecklestr. 1-5, D-78467 Konstanz,Germany
-------------- http://purl.org/thecliff/tcl/wiki//Richard*Suchenwirth