Reply To: TCL Proc- Create new OBX seg if OBX|5 contains over 68 chars

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf TCL Proc- Create new OBX seg if OBX|5 contains over 68 chars Reply To: TCL Proc- Create new OBX seg if OBX|5 contains over 68 chars

#57898
Rentian Huang
Participant

    Roushanak,

    Try this code, hope it helps.

    -Sam  ðŸ™‚

    Code:

     
       ITERATE: group  Basis: 1(0).1(0).1  Variable: %g1
       CALL:    Source: @gIndex, 1(0).1(0).1(%g1).OBX.00573.[0]      Destination: @gIndex
       
       set i [lindex $xlateInVals 0]
       set OBX5 [lindex $xlateInVals 1]
       set addr {1(0).1(0).1(index).OBX.00573}
       
       if {[string length $OBX5] > 68} {
           set pos 0
           while {$pos < [string length $OBX5]} {            regsub index $addr $i addr            xpmstore $xlateId $addr c [string range $OBX5 $pos [expr $pos + 67]]            regsub {(d+).OBX} $addr (index).OBX addr            incr pos 68            incr i        }    } elseif {[string length $OBX5] > 0} {
           regsub index $addr $i addr
           xpmstore $xlateId $addr c $OBX5
           incr i
       }

       xpmstore $xlateId [lindex $xlateOutList 0] c $i