Could somebody please post example of how to assign multiple array elements in one statement. Something similar to C array initialization list.
I can find commands for assigning all elements the same value, and building a array from file contents, but how about hard coding a static table.
ie. I want to do something like this:
DIM myArray(3,3) = {{1,2,3},{4,5,6},{7,8,9}}
Are such assignments possible in DS Basic?
Thanks in advance.
Dimensioned Array Assignment
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The only alternative is MAT, but this must assign the same value to every element, for example Otherwise you have discovered the correct answer. Well done.
Code: Select all
MAT myArray = 0
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.