UBOUND

From QB64 Phoenix Edition Wiki
Revision as of 14:55, 20 April 2022 by SMcNeill (talk | contribs) (Created page with "The {{KW|UBOUND}} function returns the largest valid index (upper bound) of an array dimension. {{PageSyntax}} :''result%'' = {{KW|UBOUND}}(arrayName[, dimension%]) {{PageDescription}} * {{Parameter|arrayName}} specifies the name of the array. * {{Parameter|dimension%}} specifies the dimension number, starting with <code>1</code> for the first dimension. ** If omitted, {{Parameter|dimension%}} is assumed to be <code>1</code>. ** If {{Parameter|dimension%}} is less t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Template:KW function returns the largest valid index (upper bound) of an array dimension.


Syntax

result% = Template:KW(arrayName[, dimension%])


Description

  • arrayName specifies the name of the array.
  • dimension% specifies the dimension number, starting with 1 for the first dimension.
    • If omitted, dimension% is assumed to be 1.
    • If dimension% is less than 1 or is greater than the number of dimensions, a subscript out of range error occurs.


Examples

DIM myArray(5) AS INTEGER
DIM myOtherArray(1 to 2, 3 to 4) AS INTEGER

PRINT UBOUND(myArray)
PRINT UBOUND(myOtherArray, 2)
 5
 4


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link