Skip to content

Let

Description

For assigning a value to a variable, where the value can be a constant, a database field, or an expression.

It is not necessary to declare the variable first; the type of variable is automatically determined based on the content.

Not declaring variables makes it harder to find a typo.

The variable name must start with a letter, followed by a number of alpha-numeric characters (including an underscore '_').

Syntax

Let <Variable> = <Expression>

Sample

Let x = {OrderHea.Order_Total}
Let y = 0.75
Let z = (y * x)

Notes

  • It is allowed to let the let statement define a variable inside a if .. then .. end structure, but it introduces typos; for example:
If {?UseZebraStripes} Then
    Let bResul=True
Else
    Let bResult=False
End

Return bResult

The above does not contain a syntax error but most likely does not do what you expect.