For more information... RTFM!
NAVIGATION
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

calcn

Calculates the value of the enclosed (Perl) expression.

Summary

  • [calcn] Perl expression [/calcn]

Parameter Description Default
hide Suppress any output text that would ordinarily be returned from this tag.  (This universal parameter was introduced with Interchange version 5.5.2.) No
interpolate Parse Interchange tags, included in the body text, before this container tag executes. No
reparse Process any Interchange tags found in the text output from this tag. Yes

Description

This tag is equivalent to [calc], except that it does not interpolate by default.

The enclosed region where the arguments are calculated according to normal arithmetic symbols.  For instance:

[calcn] 2 + 2 [/calcn]

will expand to: 

4

The [calcn] tag is really the same as the [perl] tag, except that it doesn't accept arguments and is more efficient to parse.  This tag does not interpolate its body text by default.  Interpolation can be turned on by either passing the interpolate=1 parameter, or by simply using the [calc] tag instead.

The [calcn] 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.

See also

Categories:  Interchange Perl usage | Interchange tags
Last modified by: Kevin Walsh
Modification date: Wednesday 27 February 2008 at 7:51 AM (CST)
Home  |  Legal nonsense  |  Privacy policy  |  Donations  |  Contact us