Siebel eScript Language Reference > Compilation Error Messages > Other Clib Methods >

Semantic Error Messages


Table 208 describes error messages that can result from semantic errors when Siebel Tools compiles ST eScript code. A semantic error message starts with the following error prefix: Semantic Error around line line#. For more information, see Semantic Warnings.

Table 208. Semantic Error Messages in Siebel eScript
Message
Examples
Cause

Argument argument_label either type does not correct or is not defined.

function main ()
{
fn (new Date(), new Date());
// type of the second parameter
// mismatches with function
// definition and cannot be
// implicitly converted to
// 'Number' type
}

function fn (arg1: chars, arg2: Number)
{
 TheApplication().RaiseErrorText  ("fn");
}
main ();

The argument passed to the function is not of the data type specified in the function definition, or is not defined in the function definition.

In the example, the arg2 parameter must be of type Number, as specified in the function definition, but the function passes the parameter, which is in the following string format:

new date

No such predefined property property_label in class object_type.

function main ()
{
 delete "123".prop1;
 // prop1 is not a property of
 // String object. Also, because
 // the String object is
 // constructed here by implicitly
 // converting "123", prop1
 // cannot be created dynamically.
}

The property is not defined in the class object.

In this example, you can specify only string object properties. The following property is not a property of the string object:

Prop1

[] operator can only apply to Object, Buffer or Array class.

Not applicable

The script is trying to use the [] operator for a type other than an object, buffer, or array.

Type mismatch: L: left_type; R: right_type.

Example 1

function TypeMismatch()
{
 var BC:BusComp;
 var MyDate:Date = new Date();
 BC =MyDate;
// MyDate is not the same data type
// as strongly typed variable BC
}

Example 1

function fn ()
{
 var a: String;
 a = new Date ();
 //Type mismatch: strongly typed
 //String is assigned a Date.
}

A value that belongs to one data type is assigned to a strongly typed variable of another data type. For more information, see Using Strongly Typed and Typeless Variables.

Return type is wrong. Defined return type is return_type.

function fn (): Array
{
 return new Date ();
}

fn ();

The actual return type is different from the defined return type. Siebel CRM cannot implicitly convert the actual return type to the defined type.

No such label label defined.

switch( switch_variable )
{
   case value1:
      statement_block
      break labl;
 // where labl is not a valid label
   .
   .
   .
   [default:
      statement_block;]
}

The label referenced in a Break statement or a Goto statement is defined. You must make sure the label name is correct and that the label is defined in the code.

In the example, if the Break statement is to resume at the labl location, then you must define the labl label.

Continue out of loop.

function ContinueOut()
{
 var i =0
 while (i<3)
 {
  i++;
  continue Mylabel;
  // Mylabel label is defined
  //outside of the while loop.
 }
 Mylabel:
 var a=1;
}

A continue command attempts to branch to a label that is not in a loop.

Label redefined.

function LabelError()
{
 Outer:
  for (var i = 0; i < 5; i++)
  {
   var j = 0;
   Inner:
    while (j!=5)
    {
     j++;
     continue Inner;
     Inner: //Label Inner is             //redefined.
      var b=1;
    }
  }
}

A label already exists that possesses the same name.

function function_label is double defined.

function fn ()
{
 TheApplication().RaiseErrorText  ("fn");
}
function fn ()
// second declaration of function
// fn is not allowed
{
 TheApplication().RaiseErrorText  ("fn again");
}

A function already exists that possesses the same name.

In the example, you must define the function with a name other than the following name:

fn

Calling function function_label with insufficient number of arguments.

function main ()
{
 fn ();
 // does not provide enough
 //parameters
}

function fn (arg1: chars, arg2: chars)
{
 ...
}

You did not provide all of the arguments that the function requires.

The number of arguments you include must equal the number specified in the function definition.

In the example, the following function requires two character arguments:

fn

Cannot access property property_name on native type.

function main ()
{
 var a:chars = "123";
 a.m_prop = "123";
 // chars is a primitive, so it
 // has no properties
}
main ();

You cannot write code that assigns a property to a variable that is of a primitive data type, such as char, float, or bool.

In the example, because chars is a primitive data type, you cannot assign it to the following property:

a.m_prop

Object_name is an invalid object type.

function main ()
{
 var a: Obj1 = "123";
 // where Obj1 is an invalid object
 // type

}
main ();

If you use Siebel eScript that is strongly typed, then you must specify a valid data type in the declaration of the variable.

In the example, the following variable is not a defined object type

obj1

For more information, see Using Strongly Typed and Typeless Variables.

Indiscriminate usage of goto.

function main ()
{
 var obj = new Object();
 with (obj)
 {
  labl:
  TheApplication().RaiseErrorText   ("in with");
 }
goto labl;
}
main ();

This script uses a Goto statement to attempt a branch to a With statement block from outside of the With statement block.

Siebel eScript Language Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.