LowerBound PowerScript function
Description
Obtains the lower bound of a dimension of an array.
Syntax
1 |
<span>LowerBound</span> ( <span>array</span> {, <span>n</span> } ) |
Argument |
Description |
---|---|
array |
The name of the array for which you want |
n (optional) |
The number of the dimension for which |
Return Values
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 |
integer a[5], b[2,5] |
1 |
<span>LowerBound</span>(a) <span></span>   // Returns 1 |
1 |
<span>LowerBound</span>(a, 1) // Returns 1 |
1 |
<span>LowerBound</span>(a, 2) // Returns -1, a has only 1 dim |
1 |
<span>LowerBound</span>(b, 2) // Returns 1 |
1 |
1 |
integer c[ ] |
1 |
<span>LowerBound</span>(c)    // Returns 1 |
1 |
c[50] = 900 |
1 |
<span>LowerBound</span>(c)    // Returns 1 |
1 |
1 |
integer d[-10 to 50] |
1 |
<span>LowerBound</span>(d)    // Returns <span>-</span> 10 |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest