Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference > Siebel eScript Commands >
User-Defined Objects
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
Predefining Objects with Constructor Functions, Assigning Functions to Objects, and Object Prototypes
Bookshelf Home | Contents | Index | Search | PDF |
Siebel eScript Language Reference Published: 18 April 2003 |