Does GCBasic allow this : Dim Variable (6, 32) ? Or must I use Dim Variable (192) and simulate the access to Variable (x, y) with a formula like Variable (32 * (x-1) + y) ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We must be clear before we start. Great Cow BASIC supports arrays of many types. Great Cow BASIC supports does not natively support multidimension arrays therefore including two dimensions arrays.
So, Dim Variable (6, 32) will create a variable of type array. The length of this array will be 2 elements. This is a single dimension array.
Therefore, use a formula or function to handle.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's an interesting question.
@Bertrand has answered his own question sort of.
I have got by with arrays as they are in gcb... albeit the dim var (10) which has element 0 holding the length of the array which never caused a problem as it would be 1 to 10. But could be useful to test that element 0 in a prog.
In the example dim var (6,32)
would you dim 6 vars as 32?
The original idea of slicing one array seems quite elegant.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does GCBasic allow this : Dim Variable (6, 32) ? Or must I use Dim Variable (192) and simulate the access to Variable (x, y) with a formula like Variable (32 * (x-1) + y) ?
We must be clear before we start. Great Cow BASIC supports arrays of many types. Great Cow BASIC supports does not natively support multidimension arrays therefore including two dimensions arrays.
So, Dim Variable (6, 32) will create a variable of type array. The length of this array will be 2 elements. This is a single dimension array.
Therefore, use a formula or function to handle.
It's an interesting question.
@Bertrand has answered his own question sort of.
I have got by with arrays as they are in gcb... albeit the dim var (10) which has element 0 holding the length of the array which never caused a problem as it would be 1 to 10. But could be useful to test that element 0 in a prog.
In the example dim var (6,32)
would you dim 6 vars as 32?
The original idea of slicing one array seems quite elegant.