Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Language Overview > Data Types in Siebel eScript > Composite Data Types in Siebel eScriptAlthough primitive data types are passed by value, composite types are passed by reference. If a parameter is passed by reference, the variable's value may be changed for the calling procedure. When a composite type is assigned to a variable or passed to a parameter, only a reference that points to its data is passed, as in the following fragment: var AnObj = new Object; After the object When With this reference, Thus, Two commonly used composite data types are Object and Array. ObjectAn object is a compound data type that consists of one or more pieces of data of any type grouped together in an object. Data that are part of an object are called properties of the object. The object data type is similar to the object data type in Visual Basic and the structure data type in C. The object data type also allows functions, called methods, to be used as object properties. In Siebel eScript, functions are considered as variables. It is best to think of objects as having methods, which are functions, and properties, which are variables and constants. ArrayAn array is a series of data stored in a variable that is accessed using index numbers that indicate particular data. The following fragments illustrate the storage of the data in separate variables or in one array variable: var Test0 = "one"; After either fragment is executed, the three strings are stored for later use. In the first fragment, three separate variables contain the three separate strings. These variables must be used separately. In the second fragment, one variable holds the three strings. This array variable can be used as one unit, and the strings can also be accessed individually, by specifying the array subscript of the element containing the string to be used. Arrays and objects use grouping similarly. Both are objects in Siebel eScript, but they have different notations for accessing properties. While arrays use subscripts, 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. |
Siebel eScript Language Reference |