Action @PASTE

Inserts content that was copied with the @COPY or @CUT actions.

Think of the common copy/cut/paste pattern. DocuMold is essentially doing that when generating a document.

Usage

<# @PASTE("name") #>

Parameters

name

(Required) The name of the @COPY or @CUT to insert the content of here. Must be a text (with quotes \"). Cannot be a variable.

Examples

Example With these variables Result

<# @COPY(“example”) #>
Some text here
One more line
<# @ENDCOPY #>
But then!
<# @PASTE(“example”) #>

(None)

Some text here
One more line
But then!
Some text here
One more line

<# @COPY(“example”) #>
Some text here
A command: <# UPPER(client_name) #>
<# @ENDCOPY #>
But then!
<# @PASTE(“example”) #>

client_name is "Anna Logwatch"

Some text here
A command: ANNA LOGWATCH
But then!
Some text here
A command: ANNA LOGWATCH

<# @IF(country = “Canada”) #>
For Canadians:
<# @COPY(“first_part”) #>
Some text here
One more line
<# @ENDCOPY #>
<# @ELSE #>
For non-Canadians:
<# @PASTE(“first_part”) #>
<# @ENDIF #>

country is "Belgium"

For non-Canadians:
Some text here
One more line

Before: <# @PASTE(“ex”) #>
<# @COPY(“ex”) #>Some text<# @ENDCOPY #>
Once: <# @PASTE(“ex”) #>
Again: <# @PASTE(“ex”) #>

(None)

Before: Some text
Some text
Once: Some text
Again: Some text

More information

Multiple @PASTE actions can be used with the same name, they will each be replaced by a copy of the content.

See also