Siebel VB Language Reference > Using Siebel VB >

About Expressions


An expression is a collection of two or more terms that perform a mathematical or logical operation. The terms are typically variables or functions that you use with an operator to evaluate to a string or numeric result. You can use an expression to perform a calculation, manipulate a variable, or concatenate a string.

Siebel VB evaluates an expression according to precedence order. You can use parentheses to override the default precedence order. The following operators are listed in order of highest precedence to lowest precedence:

  1. Numeric Operators
  2. String Operators
  3. Comparison Operators
  4. Logical Operators

Numeric Operators

Table 6 describes numeric operators.

Table 6. Numeric Operators
Operator
Description

^ (caret)

Exponentiation.

- (minus) or + (plus)

Unary minus and plus.

* (asterisk) or / (forward slash)

Numeric multiplication or division. For division, the result is a Double.

\ (backward slash)

Integer division. The operands can be Integer or Long.

Mod

Modulus or Remainder. The operands can be Integer or Long.

- (minus) or + (plus)

Numeric addition and subtraction. You can also use the + (plus) operator for string concatenation.

String Operators

Table 7 describes string operators.

Table 7. String Operators
Operator
Description

& (ampersand)

String concatenation

+ (plus)

String concatenation

Comparison Operators

Table 8 describes comparison operators. For a number, Siebel VB increases the operands to the least common type:

  • Integer is preferable to Long.
  • Long is preferable to Single.
  • Single is preferable to Double.

For a string, the comparison is case-sensitive and is according to the collating sequence that the language specifies in the Microsoft Windows Control Panel. The result is 0 for FALSE and negative 1 for TRUE.

Table 8. Comparison Operators
Operator
Description

>

Greater than.

<

Less than.

=

Equal to.

<=

Less than or equal to.

>=

Greater than or equal to.

<>

Not equal to.

Logical Operators

Table 9 describes logical operators. Siebel VB performs a bitwise operation for each operator.

Table 9. Logical Operators
Operator
Type
Description

NOT

Unary Not

Operand can be Integer or Long.

AND

And

Operands can be Integer or Long.

OR

Inclusive Or

Operands can be Integer or Long.

XOR

Exclusive Or

Operands can be Integer or Long.

EQV

Equivalence

Operands can be Integer or Long. (A EQV B) is the same as (NOT (A XOR B)).

IMP

Implication

Operands can be Integer or Long. (A IMP B) is the same as ((NOT A) OR B).

Siebel VB Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.