LowerBound
PowerScript function
Description
Obtains the lower bound of a dimension of an array.
Syntax
|
1 |
LowerBound ( array {, n } ) |
|
Argument |
Description |
|---|---|
|
array |
The name of the array for which you want the lower bound |
|
n (optional) |
The number of the dimension for which you want the lower |
Return value
Long.
Returns the lower bound of dimension n of array and -1 if n is
greater than the number of dimensions of the array. If any argument’s
value is null, LowerBound returns null.
Usage
For variable-size arrays, memory is allocated for the array when you
assign values to it. Before you assign values, the lower bound is 1 and
the upper bound is 0.
Examples
The following statements illustrate the values LowerBound reports
for fixed-size arrays and for variable-size arrays before and after memory
has been allocated:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
integer a[5], b[2,5] LowerBound(a) // Returns 1 LowerBound(a, 1) // Returns 1 LowerBound(a, 2) // Returns -1, a has only 1 dim LowerBound(b, 2) // Returns 1 integer c[ ] LowerBound(c) // Returns 1 c[50] = 900 LowerBound(c) // Returns 1 integer d[-10 to 50] LowerBound(d) // Returns - 10 |
See also