I'm gonna need to copy several arrays of simple integers.
Here's what I was able to cobble together from the wiki.
Code: Select all
'// To Save Data
type MapData
ParallaxIdent As Integer '// simple ID for which parallax bk to use
OverlayIdent As Integer
TerrainLayer(1 to 40,1 to 30) as integer
ObjectLayer(1 to 40,1 to 30) as integer
EventLayer(1 To 160, 1 To 120) As Integer
end Type
Dim MD(1 To 10) As MapData, SimInc as integer
f = FreeFile
Open "filename.map" For Binary As #f
If Err>0 Then Print "Error opening the file":End
For SimInc = 1 To 10
Put #f, ,MD(1).ParallaxIdent
Put #f, ,MD(1).OverlayIdent
Put #f, ,MD(1).TerrainLayer()
Put #f, ,MD(1).ObjectLayer()
Put #f, ,MD(1).EventLayer()
Next SimInc
Close
End
I don't have to specify where in the file to write because it will auto increment?
I don't have to specify array size, etc?
I'll have to read this stuff back into the same arrays I used to write, but I don't think I'll ever have to read out of order, should be a full write/read every time I access file.
Any tips, corrections?