|
Expression syntax
|
Previous Top Next |
|
Data type
|
Field type
|
|
String
|
String fields, date and time fields
|
|
Integer
|
SmallInt fields, byte fields, integer fields
|
|
Float
|
Float fields, currency fields
|
|
Boolean
|
Boolean (logical) fields
|
|
Operator
|
Description
|
|
+
|
Add
|
|
-
|
Subtract
|
|
*
|
Multiply
|
|
/
|
Divide
|
|
()
|
Parentheses
|
|
And
|
Logical AND
|
|
Or
|
Logical OR
|
|
Not
|
Logical NOT
|
|
=
|
Equal
|
|
<
|
Less than
|
|
>
|
Greater than
|
|
<=
|
Less than or equal
|
|
>=
|
Greater than or equal
|
|
<>
|
Not equal
|
|
Function
|
Description
|
|
Date
|
Return current date as a string
|
|
Time
|
Return current time as a string
|
|
Str(Number)
|
Converts the numeric argument to a string
|
|
Copy(Str,s,l)
|
Returns a substring of str (starting from the s-th character, returning a maximum of l characters)
|
|
Int(Number)
|
Returns the integer part of a number
|
|
Frac(Number)
|
Returns the fractional part of a number
|
|
If (Expr, r1, r2)
|
Returns r1 or r2 depending on the boolean expr
|
|
TypeOf(Expr)
|
Returns the data type of expr
|
|
Sqrt(Number)
|
Returns the square root of a number
|
|
True
|
Logical value True
|
|
False
|
Logical value False
|
|
Sum(Expr)
|
Returns the sum of expr
|
|
Count
|
Returns the number of entires
|
|
Min(Expr)
|
Returns the lowest value of expr
|
|
Max(Expr)
|
Returns the highest value of expr
|
|
Average(Expr)
|
Averages the expr
|
|
Expression
|
Description
|
|
1
|
Integer constant, returns 1
|
|
1.5
|
Floating point constant, returns 1.5
|
|
"Delphi"
|
String constant, returns "Delphi" as a string
|
|
True
|
Logical constant, returns True
|
|
1 + 2
|
Numeric calculation, returns 3
|
|
2 * (3 + 2.5)
|
Numeric calculation, returns 11
|
|
"Delphi" + " is great"
|
String calculation, returns "Delphi is great"
|
|
Name
|
Returns the value of the field Name if it exists
|
|
Customer.Name
|
Returns the value of the field Name in the Customer table
|
|
Name + " " + Contact
|
Adds the Name field, a blank and the Contact field
|
|
AmountPaid * TaxRate / 100
|
Numeric field calculation
|
|
"Printed "+ Date
|
String calculation
|
|
"Total amount paid is " + str(AmountPaid)
|
String calculation
|
|
if(AmountPaid > 5000, "Large order", "Small order")
|
Returns "Large order" if AmountPaid is greater than 5000, else "Small order"
|
|
if(CheckField, "X", " ")
|
Prints an X if CheckField is True
|