Someone just sent a request for a CC table that can duplicate a field with a different marker.
I dug around and discovered this one. It can process any number of fields at a time. This can be done using a Standard Format export from Toolbox. I recommend choosing the Automatically load output option.
I added some extra comments to clarify matters.
Hmmm, tried three times to post this message with an attachment, so now I'm just inserting the table into the message. I put in the table with most of the comments trimmed out, and with the full comments. Feel free to ask any questions:
In brief (I even trimmed out one of the fields to be duplicated).
c Duplicate a field for later modification
c =============================
group(Main)
c =============================
c This specific example will duplicate
c \lx with a \ph marker
c \ge with a \phg marker
'\lx ' > dup
store(mkr) '\ph ' endstore
store(contents)
use(EndField)
'\ge ' > dup
store(mkr) '\phg ' endstore
store(contents)
use(EndField)
c =============================
group(EndField)
c =============================
c Wait for the next field
c (or catch the end of the file)
endfile > next
'\' > out(contents)
out(mkr,contents)
dup back(1) use(Main)
=========================================================
With full comments:
c Duplicate a field for later modification
c =============================
group(Main)
c =============================
c For the fields to be duplicated
c output the original marker
c store the marker for the duplicated field
c open the store to (begin to) collect the
c contents of the field
c switch to the group EndField to detect
c the end of the field -- the point when
c all the contents are stored
c This specific example will duplicate
c \lx with a \ph marker
c \se with a \ph marker
c \ge with a \phg marker
'\lx ' > dup
store(mkr) '\ph ' endstore
store(contents)
use(EndField)
'\se ' > dup
store(mkr) '\ph ' endstore
store(contents)
use(EndField)
'\ge ' > dup
store(mkr) '\phg ' endstore
store(contents)
use(EndField)
c =============================
group(EndField)
c =============================
c Wait for the backslash signalling the
c beginning of the marker at the beginning
c of the next field
c (or catch the end of the file)
c Before outputting the backslash
c output the contents of the field that
c was just collected.
c Then create the duplicate field by
c outputting the (new) marker and the
c contents of the original field.
c output the backslash and send it to
c the Main group.
endfile > next
'\' > out(contents)
out(mkr,contents)
dup back(1) use(Main)
Karen
Toolbox Support