Running Statements In a Loop
A While statement is a type of statement that causes Siebel eScript to run the statement that occurs immediately after the While statement in a loop. If you enclose multiple statements in curly brackets, then Siebel eScript treats them as one statement and runs them in the loop. The following example includes this usage:
while( ThereAreUncalledNamesOnTheList() == true)
{
var name = GetNameFromTheList();
CallthePerson(name);
LeaveTheMessage();
}
Siebel eScript treats the three lines that occur after the While statement as one unit. The brackets cause Siebel eScript to run the script through each line until it calls every name that resides in the list. If you remove these brackets, then it does the following:
Runs the loop only for the first line.
Processes the names on the list but only calls the last name.