TIlabFStream

Declaration: TIlabFStream = class(TFileStream)
TIlabFStream will open a named file and provide methods to read from or write to it. The following list provides the most important properties and methods of the TIlabFStream class:

Sample
program:
The following short program shows how to read a text file line by line. The read lines are displayed in the console window:
program ReadTextFile;

var
  i              : integer;
  FName          : string;
  fs             : TIlabFStream;
  astr           : string;

begin
FName := SelectFile (GetILabDir(idWork), '*.txt', 'Select a file');
if FName <> '' then
  begin
  fs := TIlabFStream.Create (FName, fmOpenRead);
  while not fs.Eos do
    begin
    astr := fs.ReadLn(0);
    couts (astr);
    end;
  fs.Free;
  end;
end.


Last Update: 2018-Apr-04