Still very new to Tcl, I’m tasked with adding to an existing script by moving an AIP.3.6 field to the AIP.3.7 field. I’ve noticed that not every message contains an AIP.3.6 field. So the script would only apply if the message has an AIP seg. And if that AIP.3.6 has a value before moving to AIP.3.7.
I know an if/else statement is needed here. Just not quite sure how to implement that.
Below is what I started on taking apart the message and replacing AIP.3.7 with the value in AIP.3.6.
} elseif [cequal $stype AIP] {
set aipflds [split $seg $fldsep]
set aip_3 [lindex $aipflds 3]
set aip_3flds [split $aip_3 $subfldsep]
set aip_3_6 [lindex $aip_3flds 5]
set aip_3_7 [lindex $aip_3flds 6]
set aip_3_7fld [lreplace $aip_3_7 0 0 $aip_3_6]
Any help would be appreciated.
Thank you!