Calculates the value of the enclosed (Perl) expression.
- [calc] Perl expression [/calc]
||Suppress any output text that would ordinarily be returned from this tag.
(This universal parameter was introduced with Interchange version 5.5.2.)
||Parse Interchange tags, included in the body text, before this container tag executes.
||Process any Interchange tags found in the text output from this tag.
The enclosed region where the arguments are calculated according to
normal arithmetic symbols.
will expand to:
The [calc] tag is really the same as the [perl]
tag, except that it doesn't accept arguments,
Interchange tags by default and is more efficient to parse.
Interpolation can be turned off by either passing the interpolate=0
parameter, or by simply using the [calcn] tag instead.
The [calc] tag will remember variable values inside
the current page,
unless scoped with "my",
so you can do the equivalent of a memory store and recall for a loop.
Having said that,
you must ensure that unscoped variables are initialised to a known
value before they are used,
as their default value cannot be relied upon.
Object references are available for most Interchange tags and functions,
as well as direct references to Interchange session and configuration values.
See Interchange Perl objects for more information.