sourceFilter D:/quovadx/qdx5.3/integrator/test/tclprocs/ptrim.tcl: Failed to source filtered file: extra characters after close-brace
[0:TEST] Tcl error:
msgId = message0
proc = ‘ptrim’
args = ”
result = ‘invalid command name “ptrim”‘
errorInfo: ‘
invalid command name “ptrim” while executing
“ptrim {MSGID message0} {CONTEXT sms_ib_data} {ARGS {}} {MODE run} {VERSION 3.0}”‘
Here is the proc. I would appreciate any of you tcl pros taking a look.
proc ptrim {args} {
keylget args MODE mode
switch -exact–$mode {
run {
keylget args MSGID mh
set msg [msgget $mh]
set segs [split $msg r]
set msg “”
set obxloc [lsearch -regexp $segs “^OBX”]
set obxseg [lindex $segs $obxloc]
set obxtxt [lindex [split $obxseg|] 5]
set obxtxt1 [lindex [split $obxseg|] 1]
set obxtxt2 [lindex [split $obxseg|] 2]
set obxtxt3 [lindex [split $obxseg|] 3]
set obxtxt4 [lindex [split $obxseg|] 4]
set obx_flds “$[obxtxt1}|$[obxtxt2}|$[obxtxt3}|$[obxtxt4}”
set obx_cnt 1
set obx_out “”
foreach obxsg {
[string map “~ { }” $obxtxt] {continue}
append obx_out “OBX|${obx_cnt}|${obx_flds}|${obxsg}r”
incr obx_cnt
return “{CONTINUE $mh
}”
set new_msg [lreplace $segs $obxloc $obxloc $obx_out]
msgset $mh [join $new_msg r]
}