04-01-2004, 07:24 AM
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"
Code:
LoadMatrix "Matrix.txt"
Code:
Matrix$(10, 10) = "Yay!!"
Code:
UpdateMatrix "Matrix.txt"
I hope this will suffice, but if not i'll be right here!