Common Statements and Examples
This section lists examples of the following common statements:
- Assignment
- Datetime Expressions
- Conditional Logic
- String Conditions and Functions
- Numeric Functions
- Raise Compliance Error Function (cerror)
- Number of Errors Function (numerrors)
- Remove Field Value Function (empty)
- Existence of Data Function (exist)
- Count Function (count)
- Delete Function (delete)
- Data Block Functions (readblock, unreadblock, writeblock)
Assignment
The assignment statement is the most powerful and most often used extended rule statement. In its simplest form, it has the following syntax:
variable=expression
However, you can use this statement in more flexible and complex ways:
numeric_variable=numeric_expression
numeric_field=numeric_expression
string_variable=string_expression
string_field=string_expression
datetime_variable=datetime_expression
datetime_field=datetime_expression
Numeric Expression
A numeric expression can consist of numbers, numeric fields, numeric variables, and numeric functions combined with the standard arithmetic operators.
String Expression
A string expression can consist of string constants, string fields, string variables, and string functions concatenated with the plus sign (+).
Datetime Expression
A datetime expression can consist of a datetime constant, datetime field, or datetime variable.
Examples
Here are some examples of assignment expressions:
a = 5;
a = b + c;
s = "hello";
s = s + "world";