Siebel eScript Language Reference > Siebel eScript Language Overview > About the Siebel eScript Script Engines >

Incompatibilities Between the ST eScript and the T eScript Engines


The eScript scripting engines differ in their treatment of scripting elements in several ways. These incompatibilities are described as follows:

  • Variable data typing. The ST eScript engine supports strong typing, or assigning a variable's data type when the variable is declared, so that the type-binding occurs at compile time. Both engines support typeless variables, whose binding occurs at run time.

    Typically, strongly typed variables provide improved performance, as compared with their typeless counterparts.

    For more information, see Data Typing in Siebel eScript.

  • Comparison operations. The ST eScript engine compares object values when performing equality comparisons for typeless variables but it compares object identities when performing equality comparisons for strongly typed variables. If you are not aware of this difference, the results of comparison operations involving strongly typed variables can be misleading.

    For further information on using the equality operator with strongly typed variables, see Logical Operators and Conditional Expressions in Siebel eScript.

  • Accessing objects and arrays. On the T eScript engine, accessing an array item, or accessing an object function or data, automatically creates a new object. This is not the case on the ST eScript engine; the object to be accessed must be explicitly initialized. The following script examples illustrate these differences between the eScript engines:
    • Accessing Object Functions or Data

      The following script runs correctly using the T eScript engine but fails at runtime using the ST eScript engine:

    var oArr = new Array ();
    oArr[0].m_Data =1;

    For the script to run correctly on the ST eScript engine, you must initialize the data object to be accessed, as follows:

    var oArr = new Array ();
    oArr[0] = new Object ();
    oArr[0].m_Data =1;

    • Accessing Arrays

      When accessing an array item, the following script runs correctly using the T eScript engine but not on the ST eScript engine:

    var oArr = new Array ();
    oArr[2][3].m_Data = 2;

    The script runs correctly on the ST eScript engine if you initialize the array to be accessed as follows:

    var oArr = new Array ();
    oArr[2] = new Array ();
    oArr[2][3] = new Object ();
    oArr[2][3].m_Data = 2;

  • Implicit variable type conversion. There are differences in how implicit type conversions are performed with strongly typed variables and with typeless variables. Implicit conversions happen in mixed type contexts, such as when a string variable is assigned the value of a numerical variable.

    For more information, see Implicit Type Conversion in Siebel eScript.

  • Methods. The engines restrict the parameters passed with the global.setArrayLength() method differently.

    For more information, see setArrayLength() Method.

    NOTE:  If a method (or group of methods) is supported by one engine, and not supported by the other, then the restriction is stated in the documentation for the method (or at a level that covers the group).

  • Properties. The ST eScript engine does not support the following static properties of the RegExp object:
    • RegExp.$n (including '$_' and '$&')
    • RegExp.input
    • RegExp.lastMatch
    • RegExp.lastParen
    • RegExp.leftContext
    • RegExp.rightContext

      Instead, you must modify your script to use equivalent functions on the target object itself.

  • Commands. The ST eScript engine does not support #define or #if, preprocessor alternatives that are used at compile time only. An alternative to using #define is to use a var declaration.

    For example, change

    #define MY_DEFINE "abc"

    to

    var MY_DEFINE = "abc";

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