Make sure that you really have the line:
var buildings[300];
and no var or any other object that is named "buildings" too.
This code is working perfectly for me:
Code:
var buildings[300];
function save_array()
{
var fhandle;
var i;
fhandle = file_open_write("save.txt");
i = 0;
while(i < 100)
{
file_var_write(fhandle,buildings[0*100 + i]);
file_var_write(fhandle,buildings[1*100 + i]);
file_var_write(fhandle,buildings[2*100 + i]);
i += 1;
}
file_close(fhandle);
// error("Array saved");
}