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.
William Leue Guru Joined: 03/07/2020 Location: United StatesPosts: 411
Posted: 08:07pm 10 Oct 2020
Copy link to clipboard
Print this post
I am getting "Error: Dimensions" when I try to use this
option default integer option base 1
dim Stuff(12, 4, 2, 5, 3)
This is only 1440 integer values, surely not too large. According to the docs, MMBasic is supposed to support arrays with 5 dimensions.
The firmware version is 5.05.05
Any clues?
-Bill
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1769
Posted: 10:16pm 10 Oct 2020
Copy link to clipboard
Print this post
Hi Bill,
IMHO you found your first BUG! Congratulation!
With "Option Base 1" I get the mysterious error even for DIM Stuff(1) - after I executed your code -, but not always reproducible. Strange!
I get an error for this:_
option default integer option base 1
dim integer test(1)
Without this both options:
option default integer option base 1
I can execute
DIM stuff(1200,4,2,5)
without an issue, but DIM stuff(12,4,2,5,0) results in an (Dimension) error.
I have never encountered problems related to DIM in the past.
MMBasic CMM2_Beta - V5.05.06RC2
Michael Edited 2020-10-11 08:31 by twofingers‚My name is Ozymandias, king of kings Look on my works, ye Mighty, and despair!‘ Nothing beside remains. Round the decay Of that colossal wreck, boundless and bare The lone and ...
William Leue Guru Joined: 03/07/2020 Location: United StatesPosts: 411
Posted: 10:49pm 10 Oct 2020
Copy link to clipboard
Print this post
Ok well I'm glad it's not just some idiot mistake of mine. I'll be interested in hearing Peter's take on this.
-Bill
mkopack73 Senior Member Joined: 03/07/2020 Location: United StatesPosts: 261
Posted: 01:56am 11 Oct 2020
Copy link to clipboard
Print this post
Ok, well, just a shot in the dark but:
If you ARE using OPTION BASE 1, then a dimension of value of 1 isn't actually a dimension - it's a single cell.
Without OPTION BASE 1 (ie BASE 0), then setting the value to 0 is again setting it to a single value which isn't an array then...
However, that doesn't explain why the OP's code didn't work.
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11873
Posted: 07:58am 11 Oct 2020
Copy link to clipboard
Print this post
This looks like a day-1 MMBasic bug. Will liaise with Geoff and fix in next release