Siebel eScript Language Reference > Compilation Error Messages in Siebel eScript >

Syntax Error Messages in eScript


Table 40 contains error messages that can result from incorrect script syntax when the script is compiled with the ST eScript engine.

Syntax error messages start with the error prefix "Syntax error at line line# position character#:".

Table 40. Syntax Error Messages in Siebel eScript
Message
Examples
Cause

Expected ':'

1.
function main ()
{
 var a = false;
 var b = a ? 1, 2;
 //expect : after 1
}

2.
function main ()
{
 var a = {prop1:1, prop2};
 //expect : after prop2
}

3.
function main ()
{
 var a = 1;
 var b;
 switch (a)
 {
  case 1
  //expect : after 1
   b =a;
  default
  //expect : after default
   b = 0;
 }
}

 

Expected ';'

function main ()
{
 for (i=1; i<10)
 //miss ; after i<10
 {
 ...
 }
}

 

Expected '('

function main <>
//expect ( after main
{
 ...
}

 

Expected ')'.

 

( and ) do not pair up.

 

Expected ']'.

function main ()
{
 var a = new Array (10);
 a[10 = 1;
 //expect ] after a[10 = 1
}

 

Expected '{'.

function main ()
var a = new Array (1);
//expect { before var

 

Expected '}'.

 

{ and } do not pair up.

Expected identifier.

function ()
// expect an identifier after
// function */
{
 ...
}

function main ()
{
 var;
//expect an identifier after var
}

 

Invalid token.

function main ()
{
 var a = "\u000G";
 // '\u000G' is an invalid
 // unicode escape sequence
}

function main ()
{
 var a = "\u0G";
 // '\u0G' is an invalid hex
 // escape sequence
}

There is an invalid unicode escape sequence or an invalid hex escape sequence.

Expected while.

function main ()
{
 do
 {
  ...
 }
 //expect while on this line
}

 

Throw must be followed by an expression on the same line.

 

 

Invalid continue statement.

function main ()
{
 continue;
 // continue is not within a loop
}

The continue statement is not within the body of:

  • do...while
  • while
  • for
  • for...in

Invalid break statement.

1.
function BreakError()
{
 break;
// break is not within a valid
// loop
}

The break statement is outside of the body of:

  • do...while
  • while
  • for
  • for...in

Invalid return statement. Return statement can't be used outside the function body.

function fn ()
{
 ....
}
return;
//Return is outside the function
//body.

 

Invalid left-hand side value.

function main ()
{
 new Object () = 1;
 // new Object () is not a valid
 // left value
}

 

Invalid regular expression.

var oRegExp:RegExp;
oRegExp = /[a-c*/;
// The regular expression is
// missing the closing ]. It
// should be [a-c]*.

 

Siebel eScript Language Reference