- This topic has 2 replies, 2 voices, and was last updated 18 years, 7 months ago by .
-
Topic
-
Hello All, I am trying to modify an existing TCL proc that manipulates an X12 transaction. I need the code to look at the CAS segments of the transaction. If there are two CAS segments back-to-back and the first segment has a *CO*42* in the first two fields, and the second CAS segment has an *OA* in the first field, I want to kill the first CAS segment (*CO*42*). I am attaching the code fragment that deals with the CAS segment. Could someone look at it and see where the problem is? I can’t find it. The code is currently, checking for two CAS segments back-to-back and kills the first one without looking at the fields of either CAS segment.
😕 Any help would be greatly appreciated. TIA.
CAS { if {$preSegInd == “CAS”} {
set splitSeg [split $seg *]
set Fld1 [string range $splitSeg 0 1]
if {$Fld1 == “OA”} {
set outMsg [lrange $outMsg 0 [expr [llength $outMsg] -2]]
lappend outMsg $seg
} else { lappend outMsg $seg
}
}
}
- The forum ‘Cloverleaf’ is closed to new topics and replies.