Yes, I did it the same way Jim explained.
And I already have a tcl-script to remove the last field from a VRL:
######################################################################
# Name: orbis_VRL_remove_last_field
# Created by: Robert Kersemakers
# for: Orbis Medisch en Zorgconcern
# at: 31-10-2005
# Purpose: Script om het laatste veld van een VRL-bericht
# te verwijderen. Meestal om een dummy-veld aan het eind
# van een regel te verwijderen, zodat alle delimiters getoond worden
#
# UPoC type: tps
# Args: tps keyedlist containing the following keys:
# MODE run mode (”start”, “run” or “time”)
# MSGID message handle
# ARGS user-supplied arguments:
# DEBUG Debug mode 0 (uit) of 1 (aan); default 0
# SEP Gebruikte separator; default “;”
# Returns: tps disposition list:
#
#
proc orbis_VRL_remove_last_field { args } {
keylget args MODE mode ;# Fetch mode
keylget args ARGS uargs
set debug 0 ; keylget uargs DEBUG debug
set sep “;” ; keylget uargs SEP sep
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
keylget args MSGID mh
set msg [msgget $mh];
set fieldlist [split $msg $sep]
set lengte [llength $fieldlist]
lvarpop fieldlist $lengte-1
set msgout [join $fieldlist $sep]
msgset $mh $msgout
lappend dispList “CONTINUE $mh”
return $dispList
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
default {
error “Unknown mode ‘$mode’ orbis_VRL_remove_last_field”
}
}
return $dispList
}
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands