Difference between revisions of "WriteFileString"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function WriteFileString(FileNum: Integer; const s: string): Boolean; </source> ==Availability== SCAR Divi 3.00 > Current ==De...")
 
Line 34: Line 34:
  
 
==See Also==
 
==See Also==
 +
*[[ReadFileString]]
 
*[[WriteFileByte]]
 
*[[WriteFileByte]]
 
*[[WriteFileInt]]
 
*[[WriteFileInt]]

Revision as of 14:38, 3 July 2011

Definition

function WriteFileString(FileNum: Integer; const s: string): Boolean;

Availability

SCAR Divi 3.00 > Current

Description

Writes a string s 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;
  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.

Output:

Hello World!

See Also