COPY example: Updating old translation file

This example shows how to update the old translation file to make it work under the new retrieve behavior.

To copy only the subfield content, use the subfield-level address as the source instead of the field-level address.

For example:

  { { OP COPY } 
        { ERR 0 }
        { PRE {
            #Note: Shows $xlateInVals
            puts "xlateInVals is: $xlateInVals"
        }}
        { IN Test.[1] }
        { OUT @tmp_test }
    }

This copies only the second subfield content B to the destination; xlateInVals is B only.

To copy the whole field content, but have written a pre-proc to handle the xlateInVals list, keep using the field-level address in the source. Then, update the pre-proc.

To update your proc:

 { { OP COPY } 
        { ERR 0 }
        { PRE {
            #Note: Shows $xlateInVals
            puts "The original xlateInVals is: $xlateInVals"
            regsub -all {-} $xlateInVals { } xlateInVals  (Replace the sub-field separator char with space, so that xlateInVals will become a list.)
            puts "The xlateInVals after regsub is: $xlateInVals"
            lassign $xlateInVals a b c
            puts "$a:$b:$c"
        }}
        { IN Test }
        { OUT @tmp_test }
    }   

This displays:

  • The original xlateInVals is A-B-C.
  • The xlateInVals after regsub is A B C.
  • A:B:C