function save_coords() *write file* for a=0 to array_max_position writestring (file,array(array_position)) writestring (file,array2(array_position)) array_position=array_position+1 next closefile file
surely you should be using the loop in the writestring function otherwise. Something like this.
function save_coords() *write file* for a=0 to array_max_position writestring (file,array(a)) writestring (file,array2(a)) next closefile file