Oracle® Business Intelligence Scheduler Guide > Using Oracle BI Scheduler Job Scripts > Oracle BI Scheduler Script Object Methods and Events >

CreateArray Method


This topic is part of Oracle BI Scheduler Script Object Methods and Events.

Creates an Array object.

Usage: This method is provided only for JScript because local JScript Array objects cannot be passed directly to the Script methods. This method is called to create an array object and pass the array object to Script methods that accept an array as arguments.

Syntax 1: Set array = CreateArray ()

Syntax 2: Set array = CreateArray ( size )

Syntax 3: Set array = CreateArray ( element 0, element 1, ..., element n)

The different syntax versions create arrays as follows:

  • Syntax 1 creates an array of size 0 (zero).
  • Syntax 2 creates an array with the specified size.
  • Syntax 3 creates an array filled with the specified elements.
Example

var i;
var array1= CreateArray(2);
for (i = 0; i < array1.Size; i++)
{
   array1(i) = i;
}

   array1.Resize(4);
for (i = 2; i < array1.Size; i++)
{
   array1(i) = i;
}

var array2 = CreateArray(0, 1, 2,3);
for (i = 0; i < array2.Size; i++)
{
   if (array1(i) != array2(i))
   break;
}

Arguments: Refer to Table 25 for CreateArray method arguments.

Return Value: Returns an Array object.

Table 25. CreateArray Method Arguments
Argument
Description

size

A long value that specifies the initial size of the array.

element0 ... elementn

The values to place in the array. This creates an array with the lower and upper bounds of 0 (zero) and n, respectively.

Oracle® Business Intelligence Scheduler Guide Copyright © 2007, Oracle. All rights reserved.