How do i fix this so if there is no field it doesnt error it out? Thanks for any thoughts.
set PIDList [split [lindex $segList $PIDpos] $fldSep]
set phone [lindex $PIDList $PIDphone]
if { [string index $phone 0] == “(” } {
set phone [string range $phone 0 12]
} else {
set phone “”
}
lset PIDList $PIDphone $phone