Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Methods Reference > Array Methods > About Associative ArraysAn associative array is a type of array that uses a string as an index element. This capability is useful if you must associate a value with a specific name. For example, you can create a month array where the elements are the names of the months and the values are the number of days in the month. You use a string as an index to reference items in an associative array. For example: array_name["color"] = "red"; The associative array is the only type of array that you can use with the following type of statement: This statement loops through every element in an associative array or object, regardless of how many elements it contains. For more information, see For In Statement. Siebel CRM uses a hash table to implement the associative array, so the elements are not in an order that an indexed array uses, and you cannot use array methods with an associative array, such as split, join, or length. Example of Using an Associative ArrayThe following example creates an associative array of months and days, and totals the number of days: // open file // populate associative array // iterate through array items The following is the output from this example: November = 30 |
Siebel eScript Language Reference | Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |