An old method is as follows
global xmax
global ymax
global myarray[100,100] as integer
function savearray(xmax,ymax)
write = OpenToWrite("array.txt" ,0)
String$ = Str(xmax)
WriteLine (write,String$)
String$ = Str(ymax)
WriteLine (write,String$)
for y = 1 to ymax
for x= 1 to xmax
String$ = Str(myarray[x,y])
WriteLine (write,String$)
next x
next y
Closefile(write)
endfunction
function loadarray()
If GetFileExists("array.txt")
read = OpenToRead("myarray.txt")
String$ = ReadLine(read)
xmax=val(string$)
String$ = ReadLine(read)
ymax=val(string$)
for y = 1 to ymax
for x= 1 to xmax
String$ = ReadLine(read)
myarray[x,y]=val(string$)
next x
next y
Closefile(read)
endif
endfunction
but the json method above is much better if your familiar with json files
fubar