Siebel eScript Language Reference > Siebel eScript Language Overview > Siebel eScript Concepts >

Expressions, Statements, and Blocks in Siebel eScript

An expression or statement is any sequence of code that performs a computation or an action, such as the code var TestSum = 4 + 3, which computes a sum and assigns it to a variable. Siebel eScript code is executed one statement at a time in the order in which it is read.

Many programmers put semicolons at the end of statements, although they are not required. Each statement is usually written on a separate line, with or without semicolons, to make scripts easier to read and edit.

A statement block is a group of statements enclosed in curly braces, ({}), which indicate that the enclosed individual statements are a group and are to be treated as one statement. A block can be used anywhere that a single statement can.

A while statement causes the statement after it to be executed in a loop. If multiple statements are enclosed within curly braces, they are treated as one statement and are executed in the while loop. The following fragment illustrates:

while( ThereAreUncalledNamesOnTheList() == true)
   var name = GetNameFromTheList();

The three lines after the while statement are treated as a unit. If the braces were omitted, the while loop would apply only to the first line. With the braces, the script goes through the lines until everyone on the list has been called. Without the braces, the script goes through the names on the list, but only the last one is called.

Statements within blocks are often indented for easier reading.

Siebel eScript Language Reference