Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 04:05 15 Nov 2025 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : Problem with 5D integer array

Author Message
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
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: Germany
Posts: 1677
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
causality ≠ correlation ≠ coincidence
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
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 States
Posts: 261
Posted: 01:56am 11 Oct 2020
Copy link to clipboard 
Print this post

  twofingers said  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



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 Kingdom
Posts: 10582
Posted: 07:58am 11 Oct 2020
Copy link to clipboard 
Print this post

  Quote   DIM stuff(12,4,2,5,0) results in an (Dimension) error.

This looks like a day-1 MMBasic bug. Will liaise with Geoff and fix in next release

  Quote    If you ARE using OPTION BASE 1, then a dimension of value of 1 isn't actually a dimension - it's a single cell.


This correctly gives an error
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025