chain

chain


ch Index Level chapter
Syntax .chain {dict} {file.reference} item-id
Category Output Processor
Type Command
Description passes control to a specified item-id in the same (current) file or in a different (file.reference) file.

If "file.reference" is not specified, the current "file.reference" is used.

The {dict} and {file.reference} are both optional.

If "dict" is not specified, the "data" section of the file is assummed. If no "file.reference" is given, the item is read from the same file as the item being processed.

Control does not return to the source item after executing the 'chained' item.
Options
See Also sselect OP commands read readnext Output Processor
Example :u document letter
Dear  .readnext

You may have won one million ($1,000,000) dollars.

Sincerely,
John Doe
.chain letter

This command proves particularly useful for generating  form-letters. It is possible to insert the name and address of each recipient of the letter from a separate file.

A "sselect" statement is used to extract the relevant data from the file and save it in a list.

A series of ."readnext" statements inserts the data into the text of the letter.

At the end of the letter, a ".chain" command is used to restart the next letter. When the list is exhausted, OP will stop.
Warnings
Compatibility D3 7.0 AP
ch Index Level chapter