You are here: Using BML > Functions & Scripts > 2-D Arrays

2-D Arrays

OVERVIEW

The following functions initialize arrays without specifying the size. At a later time, when the values are assigned in different array indexes, the system expands the array into the appropriate size automatically.

Specifying a negative number (including NaN, which is equal to -999999) for the array size throws a runtime exception. For example, arr = boolean[-9][0]; throws a RuntimeException.

When you specify the array size equal to jNaN, then an array of size 0 is initialized.

Contact admin for size limits.

ADMINISTRATION

ClosedBoolean()()

Initializes a 2-D Boolean array with the specified size.

For a 2-D Boolean array, the value in each field of the array after the array declaration (for example, arr = boolean[10][2];) is equal to false if the array fields are not initialized.

These arrays are dynamic in nature and the length can be increased.

Syntax: Boolean[][] boolean[Integer n][Integer n]

Parameters:

# Parameter Data Type Description
1 boolean[][] Boolean Array Used to declare a 2-D Boolean array.
2 [n] Integer Optional: Use number "n" to declare an array of a specific size.
3 [n] Integer Optional: Use number "n" to declare an array of a specific size.

Return Type: Boolean[][]

Example of boolean()():


ClosedDate()()

Initializes a 2-D Date array with the specified size.

For a 2-D Date array, the value in each field of the array after array declaration (for example, arr = date[10][2];) is equal to null if the array fields are not initialized.

These arrays are dynamic in nature and the length can be increased.

Syntax: Date[][] date[Integer n][Integer n]

Parameters:

# Parameter Data Type Description
1 date[][] Date Array Used to declare a 2-D Date array.
2 [n] Integer Optional: Use number "n" to declare an array of a specific size.
3 [n] Integer Optional: Use number "n" to declare an array of a specific size.

Return Type:Date[][]:

Example of date()():


ClosedFloat()()

Initializes a 2-D Float array with the specified size.

For a 2-D Float array, the value in each field of the array after array declaration (for example, arr = float[10][2];) is equal to 0.0 if the array fields are not initialized.

These arrays are dynamic in nature and the length can be increased.

Syntax: Float[][] float[Integer n][Integer n]

Parameters:

# Parameter Data Type Description
1 float[][] Float Array Used to declare a 2-D float array.
2 [n] Integer Optional: Use number "n" to declare an array of a specific size.
3 [n] Integer Optional: Use number "n" to declare an array of a specific size.

Return Type: Float[][]

Example of float()():


ClosedInteger()()

Initializes a 2-D Integer array with the specified size.

For an 2-D Integer array, the value in each field of the array after array declaration (for example, arr = integer[10][2];) is equal to 0 if the array fields are not initialized.

These arrays are dynamic in nature and the length can be increased.

Syntax: Integer[][] integer[Integer n][Integer n]

Parameters:

# Parameter Data Type Description
1 integer[][] Integer Array Used to declare a 2-D array.
2 [n] Integer Optional: Use number "n" to declare an array of a specific size.
3 [n] Integer Optional: Use number "n" to declare an array of a specific size.

Return Type: Integer[][]

Example of integer()():

Notice the multiple print statements being used in the code above. We are printing a specific element index and value index. Since there are two elements, the element indexes are 0 and 1 respectively. Each element has two values, so the value indexes are also 0 and 1. The syntax used in the code will print each value in the console.


ClosedString()()

Initializes a 2-D String array with specified size.

For a 2-D String array, the value in each field of the array after array declaration (for example, arr=string[2][3])) is equal to null if the array fields are not initialized.

Syntax: String[][] string[Integer n][Integer n]

Parameters:

# Parameter Data Type Description
1 string[][] String Array Used to declare a 2-D string array.
2 [n] Integer Optional: Use number "n" to declare an array of a specific size.
3 [n] Integer Optional: Use number "n" to declare an array of a specific size.

Return Type: String[][]

Example of string()():


NOTES

    BML size limits have default settings. The default row size is 5000. The default column size is 50.

    To increase the default row and column size, open a ticket on My Oracle Support.
    In a 2-D array, the maximum number of rows is 1000 and columns is 50.
    NULL and blank Integer values are treated as separate values.

    - NULL= 0
    - Blank = ""

    If you use logic that tests for NULL values in rule conditions or BML, this logic should be updated.

    Using "null" as an attribute value is strongly discouraged.

RELATED TOPICS

Related Topics Link IconSee Also