bobbimanners / EightBall

The Eight Bit Algorithmic Language for Apple II, Commodore 64 and VIC20
GNU General Public License v3.0
19 stars 3 forks source link

When dimensioning array, must be a literal constant #11

Closed bobbimanners closed 6 years ago

bobbimanners commented 6 years ago

You can do this: word aa[10]=0; but not this word aa[10*10]=0; This is because the parser is very stupid. I plan to fix this at some point.

bobbimanners commented 6 years ago

Note that dynamic dimensioning works fine in interpreter. This is a compiler limitation at present.

bobbimanners commented 6 years ago

I have fixed this. Array dimensions must be known at run time, but constant expressions are now allowed. This means that we can say: word w[10*10] = 1 and get a word array of 100 bytes. The multiply is done at compile time, not run time.