Table 30 Arguments for the Add Array Elements Method Argument Description

Table 30 arguments for the add array elements method

This preview shows page 82 - 85 out of 334 pages.

Table 30. Arguments for the Add Array Elements Method Argument Description element1, element2, . . . elementn A list of elements to add to the array.
Image of page 82
Methods Reference Array Methods Siebel eScript Language Reference Version 8.1, Rev. A 83 Format arrayName .join([ separatorString ]) Table 31 describes the arguments for the Create Array Elements method. Usage Commas separate the array elements by default. The following example sets the value that the string variable contains to 3,5,6,3: var a = new Array(3, 5, 6, 3); var string = a.join(); To separate the array elements, you can also pass another string as an optional argument to the Create Array Elements method. Example The following example creates a string that contains 3*/*5*/*6*/*3: var a = new Array(3, 5, 6, 3); var string = a.join("*/*"); Delete Last Array Element Method The Delete Last Array Element method does the following: 1 Gets the length of the current Array object. 2 If the length is defined or is not 0, then it does the following: a Returns the last element. b Deletes the last element. c Decreases the length of the current array object by one. 3 If the length is undefined or is 0, then it returns an undefined value. The Delete Last Array Element method works on the end of an array. To work on the beginning of an array, you must use the Array Shift method. Format arrayName .pop() Table 31. Arguments for the Create Array Elements Method Argument Description separatorString A string of characters that occur between consecutive elements of the array. If you do not use a separatorString argument, then you can use a comma.
Image of page 83
Siebel eScript Language Reference Version 8.1, Rev. A Methods Reference Array Methods 84 Example The following example includes the Delete Last Array Element method: var a = new Array( "four" ); TheApplication().RaiseErrorText("First pop: " + a.pop() + ", Second pop: " + a.pop()); // First displays the last (and only) element, the string "four". // Then displays "undefined" because the array is empty after // the first call removes the only element. Get Largest Array Index Method The Get Largest Array Index method returns the number of the largest index of the array, plus 1. This return value does not necessarily include the actual number of elements in an array because Siebel eScript does not require elements to be contiguous. Format arrayName .length Example The following example includes two arrays: var ant = new Array; var bee = new Array; ant[0] = 3 bee[0] = 88 ant[1] = 4 bee[3] = 99 ant[2] = 5 ant[3] = 6 The length property of ant and bee is equal to 4 even though ant includes twice as many array elements as bee. To remove array elements, you can change the value of the length property. For example, if you change ant.length to 2, then ant loses any elements that occur after the first two elements, and Siebel CRM loses the values stored at the other indices. If you set bee.length to 2, then bee includes the following elements: bee[0], with a value of 88 bee[1], with an undefined value Get Subarray Method The Get Subarray method gets the array elements that exist in a range starting with the value that
Image of page 84
Image of page 85

You've reached the end of your free preview.

Want to read all 334 pages?

  • Summer '16
  • Oracle
  • Type system, Siebel, Siebel eScript

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors