Format Clibsystem commandString Table 189 describes the arguments for the Clib

Format clibsystem commandstring table 189 describes

This preview shows page 294 - 297 out of 334 pages.

Format Clib.system( commandString ) Table 189 describes the arguments for the Clib Send Command method. Example The following example displays a directory in a DOS window: Clib.system("dir /p C:\\Backup"); Clib Search Array Method The Clib Search Array method searches an array for a value that you specify. It returns one of the following values: If it finds the value you specify in the key argument, then it returns an array variable that matches the value you specify in the key argument. If it does not find the value you specify in the key argument, then it returns the following value: Null It only searches through array elements that include a positive index. It ignores array elements that include a negative index. Format Clib.bsearch( key, arrayToSort, [ elementCount ,] compareFunction ) Table 189. Arguments for the Clib Send Command Method Argument Description commandString Contains the name of a valid operating system command. This value can be a formatted string followed by variables. For more information, see “Characters That Format Values” on page 234 .
Image of page 294
C Language Library Reference Other Clib Methods Siebel eScript Language Reference Version 8.1, Rev. A 295 Table 190 describes the arguments for the Clib Search Array method. Example The following example uses Clib.qsort and Clib.bsearch to locate a name and related item in a list: (general) (ListCompareFunction) function ListCompareFunction(Item1, Item2) { return Clib.strcmpi(Item1[0], Item2[0]); } (general) (DoListSearch) function DoListSearch() // create array of names and favorite food var list = { {“Brent”, “salad”}, {"Laura", "cheese" }, { "Alby", "sugar" }, { "Jonathan","pad thai" }, { "Zaza", "grapefruit" }, { "Jordan", "pizza" } }; // sort the list Clib.qsort(list, ListCompareFunction); var Key = "brent"; // search for the name Brent in the list var Found = Clib.bsearch(Key, list, ListCompareFunction); // display name, or not found if ( Found != null ) TheApplication().RaiseErrorText(Clib.rsprintf ("%s's favorite food is %s\n", Found[0][0],Found[0][1])); else TheApplication().RaiseErrorText("Can not find name in list."); } Table 190. Arguments for the Clib Search Array Method Argument Description key The value for which this method searches. arrayToSort The name of the array that this method searches. elementCount The number of array elements that this method searches. If you do not specify the elementCount argument, then it searches the entire array. compareFunction A custom function that can affect the sort order. The value for the compareFunction argument must include the following items: The key argument as the first argument A variable from the array as the second argument
Image of page 295
Siebel eScript Language Reference Version 8.1, Rev. A C Language Library Reference Other Clib Methods 296 Clib Sort Array Method The Clib Sort Array method sorts elements in an array, starting with index 0 and then continuing to the value that you specify in the elementCount argument minus 1. This method differs from the Sort Array method in standard JavaScript in the following ways: The Clib Sort Array method can sort a dynamically created array.
Image of page 296
Image of page 297

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