op.chain
Exits current item and begins processing specified item.
Syntax
.chain {dict} {file.reference} item-id
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.
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.
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
