Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>dim dimension array(s)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
DIM                      Dimension Array(s)

 DIM {STATIC | DYNAMIC} var(subscripts) [,var(subscripts)]...
 DIM {STATIC | DYNAMIC} var(min:max[,min:max]..) [,var(min:max[,min:max]..)]..

    Defines the valid subscripts and allocates storage for one or more
    arrays.

      STATIC    Array space is preallocated at compile time. STATIC is the
                default attribute for all arrays, unless a $DYNAMIC
                metastatement has been given. Static arrays result in
                faster execution.

     DYNAMIC    Array space is dynamically allocated at run time. Dynamic
                arrays result in better use of memory.

         var    A valid variable name.

  subscripts    A comma-delimited list specifying the maximum subscript
                value for each dimension of an array.

         min    The minimum subscript value for an array dimension.

         max    The maximum subscript value for an array dimension.

   -------------------------------------------------------------------------

      Notes:    Turbo Basic allows the explicit specification of subscript
                ranges, via min:max, as an alternative to the
                specification of the maximum value (with 0 or 1 as the
                minimum).

                If the min:max format is not used, the first element of an
                array is element 0, unless the OPTION BASE statement has
                been used to change the starting element from 0 to 1.

                Arrays with a maximum subscript of 10 may be used without
                a DIM statement. Arrays with subscripts larger than 10
                must be DIMensioned before they are used.

                Static arrays may not be redimensioned. Dynamic arrays may
                be redimensioned after an ERASE statement.

                The compiler does not perform bounds checking on array
                usage unless the program is compiled with the bounds-
                checking switch (on the Options menu) set.

See Also: $DYNAMIC $STATIC ERASE OPTION BASE

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson