Expressions and operators
Arithmetic/concatenation operators
| Operator | Use |
|---|---|
+ | Numeric addition between Numbers, or concatenation between char/varchar (depending on the operand types). |
- | Numeric subtraction. |
* | Numeric multiplication. |
/ | Numeric division. |
&Total = &Price * &Quantity
&Greeting = "Hello, " + &Username
Comparison operators
=, <>, <, <=, >, >= — used in Where, If, While.
Logical operators
And/Or combine comparisons (typically in If/While): And binds tighter than Or.
If &a = 1 And &b = 2 Or &c = 3
...
EndIf
WARP has no boolean type of its own: each operand is validated like any other expression.
Literals
- Numbers:
100,9.5. - Text:
"text"or'text'(equivalent). - Date/time: obtained via
TODAY()/TIME(), there’s no date literal.
Variables and fields
- Variable: always with
&(&Username). - Table field: without
&, only inside aFor Each/Newover that table (CustCode,Name). list/matrixelement:&Variable[index]/&Variable[row, col](1-based).listmethod:&Variable.Method(...)(Add/Clear/Removeas a statement,Count()as an expression) — see Data types: List.structmember:&Variable.Member(read and assignment) — see Data types: Struct.
Function/procedure calls as an expression
&variable = FunctionName(expr, ...)
See Builtin functions and @Source: control statements for your own Functions.