LBound: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
(Created page with "LBOUND(''array''[, ''dimension'']) '''Description''' LBOUND returns a long value specifying the smallest available subscript in dimension of an array, ''array''. The require...")
 
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
LBOUND(''array''[, ''dimension''])
''This function is for BASIC compatibility. It is not available in pure JavaScript projects.''  


'''Description'''
LBound(''array''[, ''dimension''])


LBOUND returns a long value specifying the smallest available subscript in dimension of an array, ''array''. The required parameter, ''array'', is any array variable. The optional parameter, ''dimension'', specifies which dimension's lower bound is returned, beginning with the default, 1. The lower bound of any dimension of an array is always 0.
== Description ==


'''Example'''
LBound returns a long value specifying the smallest available subscript in dimension of an array, ''array''. The required parameter, ''array'', is any array variable. The optional parameter, ''dimension'', specifies which dimension's lower bound is returned, beginning with the default, 1. The lower bound of any dimension of an array is always 0.
 
== Example (Basic) ==


<pre>
<pre>
REM LBOUND Example
Rem LBound Example
'LBOUND returnslowerboundofarraydimension
'LBound returns lower bound of array dimension
DIM Other, Children(3), Parents(3, 1)
Dim Other, Children(3), Parents(3, 1)
Other = ARRAY("Damien", "Pip", "Wendy")
Other = Array("Damien", "Pip", "Wendy")
PRINT "'Other' Lower Bound:", LBOUND(Other)
Print "'Other' Lower Bound:", LBound(Other)
PRINT "'Children' Lower Bound:", _
Print "'Children' Lower Bound:", LBound(Children, 1)
  LBOUND(CHILDREN, 1)
Print "'Parents' Lower Bounds:", LBound(Parents), LBound(Parents, 2)
PRINT "'Parents' Lower Bounds:", _
  LBOUND(Parents), LBOUND(Parents, 2)
</pre>
</pre>


'''Output'''
== Output ==


<pre>
<pre>
'Other' Lower Bound:0
'Other' Lower Bound: 0
'Children' Lower Bound:    0
'Children' Lower Bound:    0
'Parents' Lower Bounds:    0      0
'Parents' Lower Bounds:    0      0
</pre>
</pre>


'''Related Items'''
== Related Items ==
 
[[array|Array]], [[dim|Dim]], [[redim|ReDim]], [[ubound|UBound]]
 
[[Category:Language Reference]]
[[Category:Variable Handling]]


[[array|ARRAY]], [[dim|DIM]], [[redim|REDIM}, [[unbound|UNBOUND]]
[[Category:BASIC Functions]]

Latest revision as of 15:28, 25 March 2019

This function is for BASIC compatibility. It is not available in pure JavaScript projects.

LBound(array[, dimension])

Description

LBound returns a long value specifying the smallest available subscript in dimension of an array, array. The required parameter, array, is any array variable. The optional parameter, dimension, specifies which dimension's lower bound is returned, beginning with the default, 1. The lower bound of any dimension of an array is always 0.

Example (Basic)

Rem LBound Example
'LBound returns lower bound of array dimension
Dim Other, Children(3), Parents(3, 1)
Other = Array("Damien", "Pip", "Wendy")
Print "'Other' Lower Bound:", LBound(Other)
Print "'Children' Lower Bound:", LBound(Children, 1)
Print "'Parents' Lower Bounds:", LBound(Parents), LBound(Parents, 2)

Output

'Other' Lower Bound: 0
'Children' Lower Bound:    0
'Parents' Lower Bounds:    0      0

Related Items

Array, Dim, ReDim, UBound