scratch
Returns the contents of a scratchpad variable.
Summary
| Parameter
|
Description
|
Default
|
| name |
The name of the scratchpad variable you would like to query. |
None |
| filter |
Modify the scratchpad variable's value (persistent unless keep is also specified). |
None |
| keep |
For use with the filter parameter |
No
|
| interpolate |
Process any Interchange tags found in the text output from this tag. |
No
|
Examples
Tag expansion example
[tmpn foo]bar[/tmpn]
[scratch foo]
|
|
bar
|
Perl example
$Tag->scratch({
name => $name,
});
|
or similarly with positional parameters:
|
$Tag->scratch($name, $attribute_hash_reference);
|
The following lookup from the
$Scratch
hash reference is more efficient than calling
$Tag->scratch(),
and yields the same result:
|
my $result = $Scratch->{$name};
|
Description
Returns the content of a scratchpad variable.
A scratchpad variable can be set using one of
[set],
[seti],
[tmp] or
[tmpn],
or can be set using the $Scratch
hashref from within a block of Perl code.
If you want to delete the scratchpad variable, after reading its value,
then use the [scratchd] tag instead of this one.
A scratchpad variable's value can be automatically initialised to a
specified default value by making use of the ScratchDefault
local (catalog.cfg) configuration directive.
Parameters
name
The name of the scratchpad variable you would like to query.
filter
Setting filter="filter1 filter2" modifies the named scratchpad
variable by running it through the specified filter(s).
See the filters category for a list of standard filters.
keep
Set keep=1 if you want the tag to return a filtered result
but do not want the filter to modify the scratchpad value itself.
If you would like to become an interchange.RTFM.info sponsor,
and get your logo into our list,
then please contact us.
The sponsorship logo list is also displayed on our home page.