I have a string which should have only numbers (ie telephone number), I am currently stripping out and checking the length to determine if the number has an area code and returning it in the format needed. What I need to do is to look and if ANY are non numeric, send a null or 11111111111 or something =like that.
Sorry about all the TEMP variables, not written by me .. !!! (NOT that I would have done any better!!)
set temp [split [lindex $xlateInVals 0] "-"]
set temp2 [string length $temp]
set temp3 [lindex $temp 0]
set temp4 [lindex $temp 1]
set temp5 [lindex $temp 2]
set nulvar ""
if {$temp2 == 0} {
set temp6 "$nulvar"
set xlateOutVals $temp6
} else {
if {$temp2 >8} {
set temp6 "$temp4-$temp5"
set xlateOutVals $temp6
} else {
set temp6 "$temp3-$temp4"
set xlateOutVals $temp6
}}
Sorry about all the TEMP variables, not written by me .. !!! (NOT that I would have done any better!!)
set temp [split [lindex $xlateInVals 0] "-"]
set temp2 [string length $temp]
set temp3 [lindex $temp 0]
set temp4 [lindex $temp 1]
set temp5 [lindex $temp 2]
set nulvar ""
if {$temp2 == 0} {
set temp6 "$nulvar"
set xlateOutVals $temp6
} else {
if {$temp2 >8} {
set temp6 "$temp4-$temp5"
set xlateOutVals $temp6
} else {
set temp6 "$temp3-$temp4"
set xlateOutVals $temp6
}}