Difference between revisions of "CloseFile"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function CloseFile(FileNum: Integer): Boolean; </source> ==Availability== SCAR Divi 3.00 > Current ==Description== Closes a fi...")
 
 
Line 33: Line 33:
 
*[[OpenFile]]
 
*[[OpenFile]]
 
*[[RewriteFile]]
 
*[[RewriteFile]]
 +
*[[AppendFile]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:File Functions]]
 
[[Category:File Functions]]

Latest revision as of 00:23, 3 November 2011

Definition

function CloseFile(FileNum: Integer): Boolean;

Availability

SCAR Divi 3.00 > Current

Description

Closes a file stream stored in the file stream resource manager associated with the index specified by FileNum. Returns true the the file stream existed and was closed.

Example

var
  f: Integer;
  s: string;

begin
  f := Rewritefile(LogsPath + 'Test.txt', False);
  WriteFileString(f, 'Hello World!');
  CloseFile(f);

  f := OpenFile(LogsPath + 'Test.txt', False);
  ReadFileString(f, s, FileSize(f))
  WriteLn(s);
  CloseFile(f);

  DeleteFile(LogsPath + 'Test.txt');
end.

See Also