09-18-2023, 11:17 AM
(09-18-2023, 07:14 AM)RhoSigma Wrote:(09-18-2023, 06:35 AM)PhilOfPerth Wrote: Should it be (or is it already) mentioned in the Wiki, that Dim var(num of elements) allows element 0, as well as the number of elements dimmed ?
So Dim var(10) actually allocates 11 element positions, not 10. (Or does it)?
This may become significant for memory usage with multi-dimensional arrays:
Dim var(10, 1000) would occupy space for about 11 * 1001 units (11011), not 10000 as I would expect.
It's mentioned already in the first two lines in the Wiki description:
https://qb64phoenix.com/qb64wiki/index.p...escription
Zero is the default for lowest index, to override use OPTION BASE 1 before DIMing your arrays or hard index your arrays using the DIM xxx(lb TO ub) syntax (see Wiki Example 4).
Sorry, missed it!
Thanks for the reply
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.)
Please visit my Website at: http://oldendayskids.blogspot.com/
Please visit my Website at: http://oldendayskids.blogspot.com/