ReadFileInt
From SCAR Divi Manual
Definition
function ReadFileInt(FileNum: Integer; var i: Integer): Boolean;
Availability
SCAR Divi 3.00 > Current
Description
Reads an integer from an open file stream associated with the index FileNum in the file stream resource manager and returns it in i. Returns false if the reading failed or the index FileNum is invalid. The file stream should have been created with OpenFile.
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