Multidimension array - load / save

WizardOz

Member
Licensed User
Longtime User
Dear B4A-gurus, I am writing to you because my mind has stopped working, and I need to get it going again...

Is there an easy way of saving / loading a multidimension-array, preferable in a readable and writable (texteditor) format?

My array will only contain numbers in the INT format.
The format of the array is (x,2). For now I am writing it in code:

B4X:
Arr(1,0) = 10
Arr(1,1) = 2
Arr(1,2) = 5
Arr(2,0) = 11
Arr(2,1) = 4

But as I am going up to a couple of hundred it will be a LOT of code-lines (and as the IDE dont save the state of show / hide subs this gives a lot of scrolling, but thats another thing completly), the point being that a text-file would be a great way of adding more lines to the array.

Do you guru's have any ideas? Pretty please with sugar on top? :sign0163:
 

stevel05

Expert
Licensed User
Longtime User
There is an awful lot of knowledge on these forums already, sometimes it just takes a little patience and/or creative searching to find it.
 
Upvote 0

WizardOz

Member
Licensed User
Longtime User
1There is an awful lot of knowledge on these forums already, sometimes it just takes a little patience and/or creative searching to find it.

So true, this quote should be on the B4A logo! :D
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
In the code found by Karmac, wich was originally posted by me, "Level" is a global variable...

The fie was a basic score table and the out put was something like :

Level1
03m20s, 487
03m31s, 398
..............
Level2
07m21s, 732
08m02s, 695
......

The code in the example reads the "Level" portion of the file, filing the 25 slots ( 5 time stamps, 5 sores), thus discarding whatever is left of the file...
Note that in my case, the file had a known values count....
 
Last edited:
Upvote 0
Top