Reply To: regular expression help

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf regular expression help Reply To: regular expression help

#58367
John Perks
Participant

    This can be done with tcl string and list manipulation.  Don’t forget, starting out, that your source value is really a list, and you want the first element of that list.  Depending on your tcl programming style, you can do it a couple of ways.

    You need to split the string (the first element of the xlateInVals list) on the . character, and get the last element of the resulting list.

    The following code will do it, and will work even if there are multiple or 0 occurences of the . character in the string.

    lindex [split [lindex $xlateInVals 0] .] [expr [llength [split [lindex $xlateInVals 0] .]] -1]

    Copy this code to your Pre TCL dialog box on the source side of the COPY action.

    To simplify your code, you could set a TCL variable to [lindex $xlateInVals 0] and reference that variable in your command string.  You can have multiple TCL command strings in your dialog box if they are separated by a semi-colon.