> Cons: Slightly more memory per entry (each number is stored as 5 bytes internally).
Actually, integer arrays use just 2 bytes per entry (contrary to simple integer variables). And integers are really all what's needed here.
Therefore, using `DIM %R(RC,6)` should come with less overhead.
As for calculating overheads: String variables use 5 byte and the memory required for the actual string (one byte per character). Arrays use 2 bytes for the name and then 2 bytes for a length offset and 1 byte for the width/length per dimension, plus the space required for the individual entries (for integers 2 bytes per entry, for floating point 5 bytes and for strings 3 bytes). So a 2D array uses 2 + (2 + 1) + (2 + 1) = 8 bytes for the header plus the space for the entries.
Regarding performance, mind that arrays come after simple variables in memory and must be relocated (moved) each time, a new simple variable is defined (or used for the first time). So make sure to define simple variables before DIM-ing arrays. (As a lesser known feature, you can define simple variables by DIM as a list at once, where no dimensions parameters are provided, which should make this easier. E.g., `DIM A$, I%, X, Y`. Mind that this also defines the lookup order, so define often used variables before infrequently used ones. Add your array-DIMs after this.)
Actually, integer arrays use just 2 bytes per entry (contrary to simple integer variables). And integers are really all what's needed here.
Therefore, using `DIM %R(RC,6)` should come with less overhead.
As for calculating overheads: String variables use 5 byte and the memory required for the actual string (one byte per character). Arrays use 2 bytes for the name and then 2 bytes for a length offset and 1 byte for the width/length per dimension, plus the space required for the individual entries (for integers 2 bytes per entry, for floating point 5 bytes and for strings 3 bytes). So a 2D array uses 2 + (2 + 1) + (2 + 1) = 8 bytes for the header plus the space for the entries.
Regarding performance, mind that arrays come after simple variables in memory and must be relocated (moved) each time, a new simple variable is defined (or used for the first time). So make sure to define simple variables before DIM-ing arrays. (As a lesser known feature, you can define simple variables by DIM as a list at once, where no dimensions parameters are provided, which should make this easier. E.g., `DIM A$, I%, X, Y`. Mind that this also defines the lookup order, so define often used variables before infrequently used ones. Add your array-DIMs after this.)