Operators


SEARCHScript provides a wide assortment of standard operators that let you customize query processing and results formatting to create a Web-based search application. The following table provides a brief summary of different operator types available:
Type
Description
Arithmetic
Addition, subtraction, multiplication, division, and modulus (remainder) operators.
Boolean
Logical AND, OR, and NOT operators.
Relational
Greater than (or equal to), less than (or equal to), Equals operators.

You can override the natural precedence of operators by using parentheses.

Binary and Arithmetic Operators

SEARCHScript provides the following set of arithmetic operators you can use in expressions.
Operator
Description
+
Unary or Addition operator. This operator can be used for numbers and strings.
-
Subtraction.
*
Multiplication.
/
Division.
%
Modulus (remainder).

The precedence of the Addition (+) and Subtraction (-) operators is lower than *, / and % which is in turn lower than unary operators + and -. Associativity is left to right for all operators used in expressions.

Relational Operators

SEARCHScript provides the following set of relational operators you can use in creating expressions. Relational operators can be used with all data types. String comparisons are case-insensitive. For case-sensitive comparisons, use the StrComp() function.
Operator
Description
>
Greater than operator.
<
Less than operator.
=
Equals operator (case-insensitive).
<>
Not equal to operator.
>=
Greater than or equal to operator.
<=
Less than or equal to operator.

Relational operators have lower precedence than either bitwise or arithmetic operators.

Boolean Operators

SEARCHScript provides the following set of Boolean operators you can use in creating expressions.
Operator
Description
NOT
Logical NOT operator.
AND
Logical AND operator.
OR
Logical OR operator.

The following statements provide an example of how you might use the Boolean operators in a template file:


<% If IsEmpty(Title) AND IsEmpty(URL) Then %>
<% Print ("No title!") %>
<% Endif %>




Copyright © 2000, Verity, Inc. All rights reserved.