> Building your report / Expressions / Functions / Operators

See also

Herb 50 Accounts example: Expressions with operators

Herb 50 Payroll example: Expressions with operators

Operators

Below is a list of Operators, which can be used in expressions.

Operator

Action

+

Add numbers or text.

-

Subtract numbers or text.

*

Multiply values

/

Divide.

%

The remainder of a division (modulus); for example, 5%2 = 1.

^

Raise to the power of. This raises the value on the left hand side to the power on the right hand side; for example, 3 ^2 = 9.

=

Equals (numbers).

<>

Not equal to.

>

Greater than.

<

Less than.

>=

Greater than or equal to.

<=

Less than or equal to.

()

Use rounded brackets to enter more than one calculation in your expression. Report Designer will use the calculation within the brackets first.

,

Separate values supplied as parameters to a function.

;

Separates expressions to be executed as part of a begin/end block.

AND

And/also. To include two or more different rules in your expression. Report Designer will only choose records that meet all the conditions of your expression.

OR

Either/or. The OR operator allows you to link expressions together. Report Designer will select data if one or more of the clauses of your expression is true.

NOT

Not true. Use this to exclude data or to test conditions.

LIKE

LIKE is the text equivalent of =. However, you can only use LIKE with text. You can also combine LIKE with wildcards.

NOT LIKE

Use this to apply an exclusion clause in your expression.

:

Use a colon as a separator.

->

Use this to check for a property in the value on the left, e.g. TextStyle->Color := NamedColor("Red").

:=

Assign a value, e.g. Visible := False;.

? :

Select one of two options- use this to select one of two possible options, based on the result of a test.

TRUE

True can be used as part of a comparison filter to check if a variable contains a date. Or as an assignment within a conditional formatting expression. For example, to prevent text from automatically wrapping to a new line in a text box, use WordWrap:=True.

FALSE

False can be used as part of a comparison filter to check if a variable does not contain a date. Or as an assignment within a conditional formatting expression. For example, to prevent text from automatically wrapping to a new line in a text box, use WordWrap:=False.

NULL

Use this to indicate the field has no value. For example, to indicate no border, use Border:=Null.

IF

Use this to execute an expression only if a condition is met. The optional ELSE section allows you to execute a different expression if the condition is not met. Use with BEGIN and END to execute multiple expressions.

THEN

Use this to execute an expression only if a condition is met. The optional ELSE section allows you to execute a different expression if the condition is not met. Use with BEGIN and END to execute multiple expressions.

ELSE

Use this to execute an expression only if a condition is met. The optional ELSE section allows you to execute a different expression if the condition is not met. Use with BEGIN and END to execute multiple expressions.

BEGIN

BEGIN is a text equivalent of {.

END

END is the text equivalent of }.

{}

Grouping brackets, to group multiple expressions together. These brackets allow all of the expressions in the group to be executed in sequence.

BEGIN and END are text equivalents of { and }.

SWITCH

To select which expression to execute based on the value of a field or the value returned from a function. Use with BEGIN and END to execute multiple expressions.

CASE

To select which expression to execute based on the value of a field or the value returned from a function. Use with BEGIN and END to execute multiple expressions.

DEFAULT

To select which expression to execute based on the value of a field or the value returned from a function. Use with BEGIN and END to execute multiple expressions.


Go to top