News:

  • September 27, 2026, 05:49:00 PM

Login with username, password and session length

Author Topic: 2 dimensional arrays in 2.5  (Read 12505 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
2 dimensional arrays in 2.5
« on: March 28, 2019, 03:29:34 PM »
I see you've added this feature in Math boxes. Before you were limited to 64 for the offset for 2 dim, for use anywhere in the program. So now you can do the full 16 bit range in both dimensions, but only in the Math box?  Do they have to be Vmem locations or can you use UDTs?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: 2 dimensional arrays in 2.5
« Reply #1 on: March 28, 2019, 03:32:34 PM »
I see you've added this feature in Math boxes. Before you were limited to 64 for the offset for 2 dim, for use anywhere in the program. So now you can do the full 16 bit range in both dimensions, but only in the Math box?  Do they have to be Vmem locations or can you use UDTs?

This isn't new. It's not really multi-dimension, it's just allowing a full expression between the brackets. There are no practical limits to the expression. Works in the MATH output field too.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: 2 dimensional arrays in 2.5
« Reply #2 on: March 28, 2019, 03:39:36 PM »
So the offset can now be a variable or expression in Math boxes only, but is the second index still limited to a value of 63 or can it be larger?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: 2 dimensional arrays in 2.5
« Reply #3 on: March 28, 2019, 03:41:19 PM »
So the offset can now be a variable or expression in Math boxes only, but is the second index still limited to a value of 63 or can it be larger?

No...everything between the brackets is an expression. D[V0 + 10 * sqrt(pi()) - 12.3 / R13] is a valid array index.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: 2 dimensional arrays in 2.5
« Reply #4 on: March 28, 2019, 03:45:13 PM »
That's why I've said we can support N dimension arrays. D[A*ASize + B*BSize + C*CSize + D] is a not perfect, but manageable, replacement for D[A][ B][C][D]. The MATH output parameter can do it too.
« Last Edit: March 28, 2019, 03:47:57 PM by BobO »
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: 2 dimensional arrays in 2.5
« Reply #5 on: March 28, 2019, 03:50:45 PM »
That could be very useful. Thanks for the example.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: 2 dimensional arrays in 2.5
« Reply #6 on: April 05, 2019, 12:40:39 PM »
The thing that goes with this that can be kind of cool is that the MATH expression is allowed to be a constant.  SO, you can use it as a SET/RESET for a register with a full expression as the pointer.

Turn the thing on it's head, in otherwords.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.