If I have a string that is 1234567890 and I want to translate it to “123 456 7890” what is the easiest way using an xlate. I’ve not done much with xlates having previously done most transforms in tcl. Any help greatly appreciated.
You will need to use Tcl at the COPY action (for example) to format. Just make sure you know how to deploy an xltp type proc and remember the in and out values are lists.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.
Looks like you already did the hard work, but got tangled with sending the result back.
Always remember that xlateInVals and xlateOutVals are lists. So if you have your result “123 456 7890” in variable ‘value’, then you always need to do
Code:
set xlateOutVals [list $value]
instead of
Code:
set xlateOutVals $value
.
The first will return your result as the first element of the list, where each element will be assigned to the corresponding (outbound) field.
The second will see your result as the list itself, so the first element of this list is “123” and that will be assigned to the (first) outbound field.
Zuyderland Medisch Centrum; Heerlen/Sittard; The Netherlands