- 4.62.2.13 -
Standard Units
System Unit
System Unit Procedures and FunctionsClose procedure
Targets: MS-DOS, OS/2, Win32
System Unit
Closes an open file.
Declaration:
procedure Close(var F);
Remarks:
F is a file variable of any file type previously opened with
Reset, ReWrite
or Append. The external file associated
with F is completely updated and then closed, freeing its file
handle for reuse.
With {$I-}, IOResult returns zero
if the operation was successful; otherwise, it returns a nonzero error code.
Example:
var
Fi: Text;
begin
Assign(Fi, 'C:\DATAFILE.DOC');
ReWrite(Fi);
WriteLn(Fi, 'A New File.');
Close(Fi); // Close and flush buffer to disk
end.
See also:
Assign
{$I} - I/O Checking Switch
|
|
|
Chr function |
Table of Content |
CompareMem function |
- 4.62.2.13 -