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

Semantic Warnings in eScript


Typically, semantic warnings make you aware of script that will run, but may produce unexpected results or may be inefficient. Semantic warnings do not display during compilation. Instead, view them in Oracle's Siebel Tools product by choosing Debug > Check Syntax.

Table 43 contains semantic warnings in eScript when the script is compiled with the ST eScript engine. See also Semantic Error Messages in eScript.

Semantic warnings start with the prefix "Semantic Warning around line line#:".

Table 43. Semantic Warnings in Siebel eScript
Message
Example
Cause

Undefined identifier identifier. Global object will be used to locate the identifier.

 

function main ()
{
 obj = new Object();
 // obj is created without being
 // declared with var.
}
main ();

An undeclared variable created within a function is not locally defined. Instead, it is created as a property of the Global object.

Variable variable might not be initialized.

function main ()
{
 var a;
 TheApplication().RaiseErrorText  (a);
}
main ();

 

Label 'label' is unused and can be removed.

function main ()
{
 var a = 1;
 labl:
 // labl is unused
 TheApplication().RaiseErrorText  (a);
}
main ();

 

Calling function function_label with insufficient number of arguments.

function main ()
{
// It is a warning condition
// instead of an error if the
// missing argument is not
// strongly typed.*/
 var c = fn ();
}

function fn (a, b)
{
 return a+b;
}
main ();

 

Type conversion from data_type1 to data_type2 may not succeed.

function main ()
{
var n: float = "123";
}

 

No such method method_name.

function main ()
{
fn ();
}
main ();

 

variable variable is double declared.

1.
function fn ()
{
 for (var n = 0 ; n < 3 ; n++)
 {
  ...;
 }
 for (var n = 0 ; n < 3 ; n++)
 // n is double declared within  // the scope of fn.
 {
  ...;
}
fn ();

2.
function main ()
{
 var string1 = "a string";
 var string1 = "another string";
 // string1 should not be redeclared.
}
main ();

A local variable is declared more than once.

To avoid this warning for the common case in Example 1, declare the counter variable outside of the for definition and use the counter variable without var in the for definition. For example:

function fn ()
{
var n;
for (n = 0 ; n < 3 ; n++)
{
...
}
for (n = 0 ; n < 3 ; n++)
{
...

The multiple declarations like that in Example 2 have the net effect of all declarations after the first declaration being interpreted as simple assignments, but with the unnecessary overhead of variable declarations. Instead, use simple assignments after the first declaration; for example:

string1 = "another string".

Siebel eScript Language Reference Copyright © 2007, Oracle. All rights reserved.