Difference between revisions of "WriteFileInt"

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

Latest revision as of 23:24, 2 November 2011

Definition

function WriteFileInt(FileNum: Integer; i: Integer): Boolean;

Availability

SCAR Divi 3.00 > Current

Description

Writes a Integer i to an open file stream with writing privileges associated with the index FileNum in the file stream resource manager. Returns false if the writing failed or the index FileNum is invalid. The file stream should have been created with RewriteFile.

Example

var
  f, i: Integer;

begin
  f := Rewritefile(LogsPath + 'Test.txt', False);
  WriteFileInt(f, 12345);
  CloseFile(f);

  f := OpenFile(LogsPath + 'Test.txt', False);
  ReadFileInt(f, i);
  WriteLn(i);
  CloseFile(f);

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

Output:

12345

See Also