the first element argument identifies and ending with the value that the last

The first element argument identifies and ending with

This preview shows page 84 - 87 out of 334 pages.

the first element argument identifies and ending with the value that the last element argument identifies. It returns a new array. Format slice ( first element , last element )
Image of page 84
Methods Reference Array Methods Siebel eScript Language Reference Version 8.1, Rev. A 85 Table 32 describes the arguments for the Get Subarray method. Example The following example includes the Get Subarray method: var v = new Array; var u; v[0] = 7; v[1] = 3; v[2] = 4; v[3] = 5; u = v.slice ( 1, 3); // u creates new array containing v[1] and v[2] values. For example, u[0] = 3, u[1] = 4. v.shift(); // Now v[0] is 3, v[1] is 4 Insert Array Elements Method The Insert Array Elements method inserts array elements into an array. It returns an array that includes the elements that it removed from the original array. It does the following work: 1 Beginning at the value that the start argument specifies, it deletes the number of array elements that the deleteCount argument specifies. 2 Inserts these deleted elements into the newly created return array in the same order in which it deletes them. 3 To make room for new elements, it adjusts the elements in the current array object. 4 Inserts the array elements that you specify in the element1, element2, . . . elementn argument. It inserts these elements sequentially in the space that it creates in Step 3 . Format arrayName .splice( start , deleteCount [, element1 , element2 , . . . elementn ]) Table 32. Arguments for the Get Subarray Method Argument Description first element The first element that this method returns. last element The last element minus one that this method returns.
Image of page 85
Siebel eScript Language Reference Version 8.1, Rev. A Methods Reference Array Methods 86 Table 33 describes the arguments for the Insert Array Elements method. Example The following example includes the Insert Array Elements method: var a = new Array( 1, 2, 3, 4, 5 ); TheApplication().RaiseErrorText(a.splice(1,3,6,7) + " " + a); // Displays 2,3,4 1,6,7,5 // Beginning at element in position 1, three elements (a[1], a[2], a[3] = 2,3,4) // are replaced with 6,7. Reverse Array Order Method The Reverse Array Order method reverses the order of the array elements so that the last element becomes the first element. It returns the elements in reverse order. It returns this reverse order in the arrayName argument. It reverses the existing array. It does not return a new array. Format arrayName .reverse() Example The following example includes the Reverse Array Order method: Table 33. Arguments for the Insert Array Elements Method Argument Description start Identifies the index at which to insert the new array elements. This method does the following: If start is negative, then it uses the value of the length of the array plus start. It inserts at the position counting back from the end of the array. For example, the following code inserts from the last element in the array: start = -1 If start is larger than the index of the last element, then it uses the length of the array. It appends new elements to the end of the array.
Image of page 86
Image of page 87

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