Region Example

In this example, buffer scoping is illustrated. Each region has separate buffer state which prevents that variables declared in other parts of the page are affected.

Smartsite SXML CopyCode image Copy Code
<se:region whitespace="remove">
    {buffer.set(a, 1795)}

    <se:region>
        {buffer.set(a, 2)}
        {sys.eval(buffer.get(a) * 2)}/
    </se:region>
    
    {buffer.get(a)}
</se:region>
{buffer.get(a, default=0)}
Example Result CopyCode image Copy Code
4/1795
0