Bookshelf Home | Contents | Index | PDF |
Siebel eScript Language Reference > Siebel eScript Language Overview > Siebel eScript Statements > for...in StatementThe for...in statement loops through the properties of an associative array or object. NOTE: The for...in statement can be used with associative arrays, which are arrays that use strings as index elements. The for...in statement is not for use with nonassociative arrays. For more information, see Associative Arrays in Siebel eScript. Syntaxfor (LoopVar in object) UsageAn object must have at least one defined property or it cannot be used in a for...in statement. Associative arrays must have at least one defined element. The statement block executes one time for every element in the associative array or property of the object. For each iteration of the loop, the variable LoopVar contains the name of one of the elements of the array or the name of a property of the object and may be accessed with a statement of the form NOTE: Properties that have been marked with the DONT_ENUM attribute are not accessible to a for...in statement. ExampleThis example creates an object called function PropBtn_Click () obj.number = 32767; for (propName in obj) Running this code produces the following results: The value of obj.number is 32767. For an example of the for...in statement used with an associative array, see Associative Arrays in Siebel eScript. |
Siebel eScript Language Reference |