Originally posted by Rick Pritchett
I am tring to create a proc that will kill a message based on fields PV1 18 and PV1 41. If PV1 is either "REF" or "RCR" and if PV1 41 is "PRE" the message is killed. Here is what i have so far:
proc filterAgiLink { args } {
global HciConnName
set mode [keylget args MODE]
switch -exact -- $mode {
start {
return ""
}
run {
set mh [keylget args MSGID]
set dispList
set msg [msgget $mh] set fldSep [string index $msg 3] set subSep [string index $msg 4] set segList [split $msg r] set PV1 [lindex [lregexp $segList {^PV1}] 0] set PV1flds [split $PV1 $fldSep] set PV1_18 [lindex $PV1flds 18]set PV1_41 [lindex $PV1flds 41] if {{$PV1_41 == "PRE"} || {$PV1_18 == "REF"} || {$PV1_18== "RCR"}} { set dispList
return $dispList } else { return $dispList }}shutdown { return ""} }}