Siebel eScript Language Reference > Siebel eScript Commands >

User-Defined Objects in Siebel eScript

Variables and functions may be grouped together in one variable and referenced as a group. A compound variable of this sort is called an object in which each individual item of the object is called a property.

In general, it is adequate to think of object properties, which are variables or constants, and of object methods, which are functions.

To refer to a property of an object, use both the name of the object and the name of the property, separated by a period. Any valid variable name may be used as a property name. For example, the code fragment that follows assigns values to the width and height properties of a rectangle object, calculates the area of a rectangle, and displays the result:

var Rectangle;

Rectangle.height = 4;
Rectangle.width = 6;

TheApplication().RaiseErrorText(Rectangle.height * Rectangle.width);

The main advantage of objects occurs with data that naturally occurs in groups. An object forms a template that can be used to work with data groups in a consistent way. Instead of having a single object called Rectangle, you can have a number of Rectangle objects, each with its own values for width and height.

See Also

Assigning Functions to Objects in Siebel eScript
Object Prototypes in Siebel eScript
Predefining Objects with Constructor Functions in Siebel eScript

Siebel eScript Language Reference