Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › multiple string commands in one line
We need to both map a “/” to a “-” and truncate a field to 10 characters. We have the two string commands to do this (map and range) but were wondering if these can be combined in one line for a pre proc in an xlate using the xlateInVals. Thanx!
Please post your current code and some sample data.
-- Max Drown (Infor)
Try the following:
set var [lindex $xlateInVals 0]
set xlateOutVals [string range [string map “/ -” $var] 0 9]
I haven’t tested it so you may need to try this for the xlateOutVals
set xlateOutVals
0 9]]
Example from hcitcl:
hcitcl>set var “MED/OB OUTPATIENT”
MED/OB OUTPATIENT
hcitcl>string range [string map “/ -” $var] 0 9
MED-OB OUT
Hope this helps…
Tom Rioux
Thanx! We will put this in the preproc and test. We will post the results. Thanx!
We put in:
and it is working to exchange the “/” and truncate the field to 10.
Thanx!