Siebel eScript Language Reference > Siebel eScript Language Overview > Data Types in Siebel eScript >

Object Data Types in Siebel eScript


The ECMAScript standard defines an object as "a member of the type Object. It is an unordered collection of properties, each of which contains a primitive value, object, or function. A function stored in a property of an object is called a method."

Siebel eScript does not implement a proper class hierarchy. Instead, objects are instantiated as type Object or are instantiated from objects descended from objects of type Object. These instantiated objects act as new object types themselves, from which other objects may be instantiated. Each object has an implicit contructor function that is implemented through the new command.

Properties can be added dynamically to any object. An object inherits all the properties of the objects in its ancestral chain.

The Object object type is the generic object type. By declaring a variable of type Object, the variable's structure is starting new, in a sense, in that it does not inherit properties from any objects descended from the Object type.

Object types that are built into the scripting engine are:

  • String. A String object is created by using the String constructor in a new expression. The string's value, a chars value, becomes an implicit property of the String object.

    A string is written using a pair of either double or single quotation marks, for example:

    "I am a string"
    'so am I'
    "344"

    The string "344" is different from the number 344. The first is an array of characters, and the second is a value that may be used in numerical calculations.

    Siebel eScript implicitly converts strings to numbers and numbers to strings, depending on the context. For more information about implicit type conversions, see Implicit Type Conversion in Siebel eScript.

  • Boolean. A Boolean object is created by using the Boolean constructor in a new expression. The Boolean object's value, a bool value (true or false), is an implicit property of the Boolean object.

    Because Siebel eScript implicitly converts values when appropriate, when a Boolean variable is used in a numeric context, its value is converted to 0 if it is false, or 1 if it is true. A script is more precise when it uses the actual Siebel eScript values, false and true, but it works using the concepts of zero and nonzero.

  • Number. A Number object is created by using the Number constructor in a new expression. The number's value, a value of primitive type float, becomes an implicit property of the Number object.

    For more information on numbers in eScript, see Numbers in Siebel eScript.

  • Array. An array is a series of data stored in a variable. Each datum is associated with an index number or string. The following fragments illustrate the storage of the data in an array variable:

    var Test = new Array;
    Test[0] = "one";
    Test[1] = "two";
    Test[2] = "three";

    The array variable Test contains three strings. The array variable can be used as one unit, and the strings can also be accessed individually by appending the bracketed index of the element after the array name.

    Arrays and objects in general use grouping similarly. Arrays are objects in Siebel eScript, but they have different notations for accessing properties than other objects. While arrays use indexes, objects use property names or methods. In practice, arrays should be regarded as a unique data type.

    Arrays and their characteristics are discussed more fully in Array Objects.

  • Null. The null object is literally a null pointer. The null object type indicates that a variable is empty, and this condition is different from undefined. A null variable holds no value, although it might have previously held one.

    The null type is represented literally by the identifier null. The keyword null enables comparisons to the null object.

    Because null has a literal representation, an assignment such as the following is valid:

    var test = null;

    Any variable that has been assigned a value of null can be compared to the null literal.

Table 3 lists the other prebuilt object types.

Table 3. Other Prebuilt Object Types in Siebel eScript
Object
Comment

BLOB

For more information, see BLOB Objects.

BlobDescriptor

For more information, see The blobDescriptor Object.

Buffer

For more information, see Buffer Objects in Siebel eScript.

BusComp

For more information, see Business Component Objects.

BusObject

For more information, see Business Object Objects.

CfgItem

This is a Siebel Product Configurator object.

Clib

For more information, see The Clib Object.

CTIData

For more information, see Siebel Communications Server Administration Guide.

CTIService

For more information, see Siebel Communications Server Administration Guide.

Date

For more information, see The Date Object.

Exception

For more information, see The Exception Object.

File

For more information, see Clib.fopen() Method.

Math

For more information, see The Math Object.

PropertySet

For more information, see Siebel Object Interfaces Reference.

RegExp

For more information, see RegExp Objects and ECMAScript specifications.

SELib

For more information, see The SElib Object.

Service

For more information, see Business Service Objects.

WebApplet

For more information, see Applet Objects.

Siebel eScript Language Reference