- This topic has 2 replies, 3 voices, and was last updated 15 years ago by .
-
Topic
-
Hey guys, I’m a Tcl amateur and I’m not real sure about how to iterate a subfield within a proc. I’m adding some leading zeros to a field but just today realized that one of our facilities is sending multiple consulting docs. However, only the first instance is getting the leading zeros.
# Consulting Doc
set pv1_9 [lindex $fields 9]
set pv1_9_list [split [lindex $fields 9] $sub_sep]
set DocNumber_9_0 [lindex $pv1_9_list 0]
if {$DocNumber_9_0 != “”} {
set nDocNum [x_prepenZeros 5 $DocNumber_9_0]
set replaceDocNum “”
append replaceDocNum $hmsId $nDocNum
set pv1_9 [join [lreplace $pv1_9_list 0 0 $replaceDocNum] $sub_sep]
set fields [lreplace $fields 9 9 $pv1_9]
}
- The forum ‘Tcl Library’ is closed to new topics and replies.