oh i didn;t knew that, then i have another solvement (or something like that, don;t know the word, sounds like the word to solve)
in his part of the code
Open To Write 1,map_name$
write string 1, str$(enemies)
write string 1, str$(enumber)
for g=1 to enemies
cls Rgb(255,255,255)
write string 1, str$(enemey(g).startx)
write string 1, str$(enemey(g).starty)
print "saving map"
next g
Close File 1
you are writing the strings enemies, enumber and the array enemy. in a function, you can;t use variables from oustide the function. so if these are global, i have no idea. if these aren't, try to make some extra function parameters or make them global
EDIT: and another one, if you set this one in a function to one
and it isn't global, outside the function, the variable still stays 0. so, maybe, the map is saved, but you don;t see it because the savemap variable isn;t changed.
*ding ding*