Sequential file problem
Hello,
I am trying to add to a sequential file or to create a new file (if one
doesn't exist).What is wrong with the following code?
{open the file}
AssignFile (OutputFile, 'C:\My Documents\student4.txt');
try
Append (OutputFile);
except on EInOutError do{file not found}
Rewrite(OutputFile);
end;
Writeln(OutputFile,edtStudent.Text);
Writeln(OutputFile,lstCourse.Items[lstCourse.ItemIndex]);
Writeln(OutputFile,edtMark.Text);
CloseFile (OutputFile);
Your help would be appreciated.
Mark