TUdataNoOctal TCL UTILITIES USER MANUAL TUdataNoOctal
SYNOPSIS
Converts an integer numerical string into a valid integer
PACKAGE
TCLUTILS
NAME
TUdataNoOctal
USAGE
set rV  [TUdataNoOctal  V {IfE}]
INPUT DEFINITIONS
V - integer numerical string
X - Optional value to return if input string has a final 0 length. Default is 0.
RETURN DEFINITION
rV - The converted value
DESCRIPTION
TUdataNoOctal converts an integer string value into a valid integer value which can be used in mathematical formulations. It is often the case that integers read from a file will have leading 0's. Tcl regards any integer with leading 0's to be an octal value and will result in an error if such a value is used in any numeric computation. This procedure strips off leading 0's. If this results in a NULL string then the procedure returns 0 if IfE is not defined or IfE if it is.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
# EXAMPLES of TUdataNoOctal usage

set A 0123
set A [TUdataNoOctal $A ]
set B 00
set B [TUdataNoOctal $B ]
set C 00
set C [TUdataNoOctal $C 0.0 ]
set D 01230
set D [TUdataNoOctal $D ]

# PRINT results

puts stderr "Input 0123  : Output $A"
puts stderr "Input 00    : Output $B"
puts stderr "Input 00    : Output $C"
puts stderr "Input 01230 : Output $D"

> Input 0123  : Output 123
> Input 00    : Output 0
> Input 00    : Output 0.0
> Input 01230 : Output 1230

      
Sept 19, 2006