Hi all
I have a program using a DIM ARRAY(40) statement. Each element can either be 0 or 1.
For the sake of clarity of the code I am wondering if any given array element could be given a more explicit name through an alias statement. For example a command along the following line:
Dim Array(1),Array(5) alias Name1,Name5 after which I could use Name1 and Name5 instead of the array elements.
Any trick that could lead to that type of result?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Hugh ! This is exactly the solution I was looking for ! As you say there is no alias option for a DIM Array(x) statement (it seems that it only works for variables). But what you suggest is working great !
Thanks again
Jacques
PS: I'll make a new post with a similar question around string variables: perhaps will you have a similar magic trick :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all
I have a program using a DIM ARRAY(40) statement. Each element can either be 0 or 1.
For the sake of clarity of the code I am wondering if any given array element could be given a more explicit name through an alias statement. For example a command along the following line:
Dim Array(1),Array(5) alias Name1,Name5 after which I could use Name1 and Name5 instead of the array elements.
Any trick that could lead to that type of result?
I don't recall ever implementing that in Dim. The best way to assign new names is to use constants. Try something like this:
The compiler should use direct addressing for those anyway, so you won't lose any code efficiency doing this.
Thanks Hugh ! This is exactly the solution I was looking for ! As you say there is no alias option for a DIM Array(x) statement (it seems that it only works for variables). But what you suggest is working great !
Thanks again
Jacques
PS: I'll make a new post with a similar question around string variables: perhaps will you have a similar magic trick :-)