[Overview][Constants][Types][Procedures and functions] Reference for unit 'objpas' (#rtl)

CloseFile

Close text or untyped file

Declaration

Source position: line 0

procedure CloseFile(

  var f:

);

procedure CloseFile(

  var t: Text

);

Description

CloseFileflushes and closes a file Fof any file type. Fcan be Textor a typed or untyped Filevariable. After a call to CloseFile, any attempt to write to the file Fwill result in an error.

It is most likely introduced to avoid confusion between the regular Closefunction and the Closemethod of TFormin the Delphi VCL.

for an example, see AssignFile.

Errors

None.

See also

#rtl.system.Close

  

Close a file

AssignFile

  

Assign text or untyped file

#rtl.system.Reset

  

Open file for reading

#rtl.system.Rewrite

  

Open file for writing

#rtl.system.Append

  

Open a file in append mode