Homepage › Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › TCL PROC for X12 transaction › Reply To: TCL PROC for X12 transaction
May 4, 2005 at 9:52 pm
#56524
Anonymous
Participant
The error could be in these lines:
set splitSeg [split $seg *]
set Fld1 [string range $splitSeg 0 1]
The split is ok but you’re creating a list of fields where the first field is actually the segment ID or “CAS”. So when you get the first two characters you get “CA” instead of what you expect.
Instead of using ‘string range’ use lindex and get the second element which should be the field that “CO” is in.
So:
set Fld1 [lindex $splitSeg 1]