Difference between revisions of "WriteFileByte"

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

Latest revision as of 00:24, 3 November 2011

Definition

function WriteFileByte(FileNum: Integer; b: Byte): Boolean;

Availability

SCAR Divi 3.00 > Current

Description

Writes a Byte b 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: Integer;
  b: Byte;

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

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

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

Output:

127

See Also