Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
andreas Senior Member Joined: 07/12/2020 Location: GermanyPosts: 226
Posted: 08:54am 03 Dec 2024
Copy link to clipboard
Print this post
Hi,
when using OPTION BASE 1 I get an error when writing dim a(1).
[3] Dim a(n) Error : Dimensions
OPTION BASE 1 n=1 DIM a(n)
If n>1 everything is fine.
I understand that the lowest index in an array is 0 when using OPTION BASE 0 and 1 when using OPTION BASE 1, but why do I need 2 values when using OPTION BASE 1?
I get the problem when reading the value of 'n' from a DATA statement by READ. The program has a DATA statement holding application data and n=1 could be a possible value for 'n'.
WebMite MMBasic RP2350A Edition V6.00.01RC1
-andreas Edited 2024-12-03 18:57 by andreas
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10067
Posted: 09:19am 03 Dec 2024
Copy link to clipboard
Print this post
MMBasic doesn't allow single element arrays. I wish it did for reasons such as array multiplication but it doesn't. I don't think this is something that could be easily changed as it is fundamental to the way the variable table is built
andreas Senior Member Joined: 07/12/2020 Location: GermanyPosts: 226