Operators - Connect_CDC - connect_cdc_mimix_share - Latest

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
Latest
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
Last edition
2024-08-20
Last publish date
2024-08-20T21:40:14.000381

Connect CDC Director complex expressions consist of a combination of programming statements that produces a return value (which may be Boolean).

The supported programming statements are compliant with the Java or C grammar for these statements, except as noted in the Expression Handler appendix in the Connect CDC Director System Reference.

Simple expressions cannot contain statements.

Basic rules for complex expressions include:

  • The first statement must be a “begin” statement (for an unnamed expression) or a “procedure” statement (for a named expression, or procedure).

  • The last statement must be an “end;” statement.

  • Statements must be terminated with a semi-colon (;).

  • Use uppercase or lowercase but not mixed case for statement names and other reserved words.

  • Blocks, or multiple statements grouped within left and right braces ({. . .}), may be specified anywhere a single statement can be used.

The following table lists the operators and their descriptions.

Operator

Description

BEGIN RETURNS type;

Denotes the beginning of an unnamed complex expression

END;

Denotes the end of an expression.

DECLARE type var;

Defines a variable in a complex expression.

DECLARE type var = <value expr>

Defines a variable in a complex expression and initializes it to the value calculated by the value expr>.

FOR (init; test; incr){ };

Executes a command to iterate over a range of values. The general form of the for statement can be expressed like this:

for (initialization; termination; increment) {
statement
}
  • The initialization expression initializes the loop. It is executed once at the beginning of the loop.

  • The termination expression determines when to terminate the loop.This expression is evaluated at the top of each iteration of the loop. When the expression evaluates to false, the loop terminates.

  • increment is an expression that gets invoked after each iteration through the loop.

  • There can be one or more statements.

All these components are optional. In fact, to write an infinite loop, you omit all three expressions.

WHILE ( ){ };

Executes a command while a specified condition is true.

DO ( ) { };  

Executes a command to evaluate the expression at the bottom of a loop instead of at the top. Thus the statements associated with a do are executed at least once.

IF ( ) { } ELSE ( );

Executes a command only if a specific condition is met; otherwise, executes another command.

SWITCH ( ) { };

Evaluates a variable that can later be matched with a value specified by the CASE keyword in order to execute a group of statements.

CASE val;

Defines a group of statements to begin executing if a value specified matches the value defined by a preceding SWITCH keyword.

DEFAULT;  

Optionally used after all CASE conditions in a SWITCH statement. If all CASE conditions are not matched by the value of the SWITCH variable, the DEFAULT keyword will be executed.

BREAK;

Forces an immediate exit from a loop.

RETURN val;

Executes a command to exit from the current method. The flow of control returns to the statement that follows the original method call.

To return a value, put the value (or an expression that calculates the value) after the return keyword:

return ++count;

==

Is equal.

!=

Is inequal.

>=

Is greater than or equal to.

<=

Is less than or equal to.

>

Is greater than.

<

Is less than.

&&

And

||

Either/or

!

Not

+

Addition

-

Subtraction

*

Multiplication

/

Division

%

Remainder (or mod)

,

Delimiter, separates items.

CR

Starts a new line. The CR can be used when coding expressions and is ignored by the expression parser.

/* comments */

Places comment text.

Type

CHAR(acter)

DEC(imal)

BOOLEAN

DOUBLE

INT(eger)