423 users using DBSP now!
home -> documentation -> EXPVAL tag


Description

The EXPVAL tag is used for dynamic calculation inside the DBSP pages. With this tag, is possible to calculate a certain value and apply a specific format to the obtained result before inserting it in the page.


Syntax

<#EXPVAL EXPRESSION="anexpression" [FORMAT="THEFORMAT"]/>

EXPRESSION You can specify in anexpression an arithmetic expression. The DBSP engine will evaluate the expression first and the result will be replaced instead of the Tag. For more information see the EXPRESSIONS property description.
FORMAT This is an optional property that can aid you to present the obtained value in different formats. For more information see the FORMAT property description.

References

EXPRESSION
FORMAT


Applications

The EXPVAL tag is very useful to perform in place calculations and avoid the use of unnecessary variables. See the examples below for a better concept understanding.

Examples

Example 1. Simple calculations using expressions.

This example shows how to calculate values using expressions and the EXPVAL tag.

Source code
Test example

Example 2. Runtime calculations.

This example shows how to calculate values on the fly using the EXPVAL tag.

Source code
Test example