1. When you load it should be something like the reverse of how you saved it so when you save it using a FOR...NEXT loop you should be using a FOR...NEXT loop to load it up.
2. The DO command seems out of place.
3. When you load up the strings you'll need to convert them back in values to be able to use them using the VAL() command.
4. Why are you using strings at all for saving this: Surely it would be more efficient to save all the data as FLOATs and LONGs? Then you won't have to bother with converting VALUES to STRINGs and back again?
I would do something like this for saving:
Open to write 1,"File.DAT"
` write height
for matx=0 to tilesx
for matz=0 to tilesz
write float 1,get matrix height(1,matx,matz)
next matz
next matx
for matx=0 to tilesx-1
for matz=0 to tilesz-1
` write tile
` tiles(x,z) is an array that is used for loading mat edit matrices
write long 1,tiles(matx,matz)
next matz
next matx
Close file 1
...and this for loading
Make matrix 1,tilesx,tilesz,tilesx,tilesz
Open to read 1,"File.DAT"
` read height
for matx=0 to tilesx
for matz=0 to tilesz
read float 1,h#
set matrix height 1,matx,matz,h#
next matz
next matx
for matx=0 to tilesx-1
for matz=0 to tilesz-1
` read tile
` tiles(x,z) is an array that is used for loading mat edit matrices
read long 1,tiles(matx,matz)
next matz
next matx
Close file 1
Or something like that - I'm pretty sure I can get this working for you so contact me on messenger
[email protected] if you get really stuck and I'll help you out.