Originally posted by Rick Pritchett
# Want to replace the segment in the list with the new one created with the string map. Any ideas?
proc String_Map { args } {
keylget args MODE mode ;# Fetch mode
set dispList {} ;# Nothing to return
switch -exact -- $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}
run {
# 'run' mode always has a MSGID; fetch and process it
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_n [lindex [lregexp $segList {^PV1}] 0]set PID_n [lindex [lregexp $segList {^PID}] 0]set PV1_n [string map "& --" $PV1_n]set PID_n [string map "& --" $PID_n]echo "$PV1_n"# Want to replace the segment in the list with the new one created with the string map. Any ideas? } time { # Timer-based processing # N.B.: there may or may not be a MSGID key in args } shutdown { # Doing some clean-up work } } return $dispList}