Code:
DECLARE SUB UpdateMatrix (FileName$)
DECLARE SUB LoadMatrix (FileName$)
DECLARE SUB MakeMatrix (FileName$)
DIM SHARED Matrix$(60, 60)
SUB LoadMatrix (FileName$)
OPEN FileName$ FOR INPUT AS #1
FOR y = 1 TO 60
FOR x = 1 TO 60
INPUT #1, Matrix$(x, y)
NEXT
NEXT
CLOSE #1
END SUB
SUB UpdateMatrix (FileName$)
OPEN FileName$ FOR OUTPUT AS #1
FOR y = 1 TO 60
FOR x = 1 TO 60
m$ = m$ + Matrix$(x, y) + ","
NEXT
PRINT #1, LEFT$(m$, LEN(m$) - 1)
m$ = ""
NEXT
CLOSE #1
END SUB
SUB MakeMatrix(FileName$)
OPEN FileName$ FOR OUTPUT AS #1
FOR y = 1 TO 60
FOR x = 1 TO 60
m$ = m$ + "Empty!,"
NEXT
PRINT #1, LEFT$(m$, LEN(m$) - 1)
m$ = ""
NEXT
CLOSE #1
END SUB
Okay! that's not too hard.
Before you do anything, you have to have a matrix created. Just call:
Code:
MakeMatrix "Matrix.txt"
Now remember, after a Matrix is created, if you call this sub again it will erase everything in the matrix. Once you have a matrix made, you have to load it.
Code:
LoadMatrix "Matrix.txt"
Once it is loaded, all you have to do to change a value is this:
Code:
Matrix$(10, 10) = "Yay!!"
That will change the value of the 10 by 10 of the matrix to "Yay!!" Now, even though it is changed in the program, it isn't saved. The last thing you do before you close the program is:
Code:
UpdateMatrix "Matrix.txt"
And that's it!
I hope this will suffice, but if not i'll be right here!