[next] [previous] [contents]

  7.4 Determining the Bounds of an Array
  BASIC provides two built-in functions, LBOUND and
  UBOUND, that allow you to determine the lower and upper
  bounds, respectively, for any dimension in an array.

  The following example sets up four variables that contain
  the lower and upper bounds of both dimensions of the array
  Sales_data
. These variables represent the years and months
  for which there is sales data available. The two FOR...NEXT
  loops print all the sales information in the array, starting
  with the first year and month, and ending with the last year
  and month.
  
EXAMPLE: Click to display example.


                                            Note



        You cannot implicitly declare arrays with the
        LBOUND and UBOUND functions. These func-
        tions can be used only with arrays that have been
        previously declared.