Andy Ball wrote:
Is there anything special that I need to do to commit a file to disk after I have written to it? My old Pascal book says to use...
CLOSE(FILEHANDLE,LOCK);
Just FMI, which Pascal compiler is this? We've seen various syntaxes in this area, but I can't remember seeing this one.
...which gpc complains about. I have tried...
CLOSE(FILEHANDLE);
That's ok. You can even omit it entirely (according to standard Pascal, files are closed automatically).
When I compile with a recent GPC (gpc-20030830), I get the:
warning: `RecordSave' defined but not used
(Hint! :-)
I'm also not sure whether I need to pass the file handle as a parameter to the procedure that's doing the writing, or how I would do that (I did try, but without success).
Since it's a global variable, you don't have to pass it, but you can (`procedure Foo (var NewMaster: StudentRecordFile)' where `StudentRecordFile' is defined as `file of StudentRecord').
Frank