Try using not "FormDestroy" (which shouldn't but might cause problems) but "FormClose" ...
Ah, I learned something again! Now I get the error on the EXE as well.
The used code:
- If the file doesn't exist:
assignfile(fDB, sDatabaseBin);
rewrite(fDB);
aDatabase[0]._wDatabase := 0;
aDatabase[0]._sDbName := '<Dummy>';
aDatabase[1]._wDatabase := 1;
aDatabase[1]._sDbName := '<Enter a name>';
write(fDB, aDatabase[0]);
write(fDB, aDatabase[1]);
closefile(fDB);
- After an update and at the end of the program:
assignfile(fDB, sDatabaseBin);
rewrite(fDB);
for w1 := 0 to wNumDB do write(fDB, aDatabase[w1]);
closefile(fDB);
I hope this helps!