File I/O is something we do easily.

Pascal provides many ways to interact with files.

Designed to work like it did in DOS

Modern Pascal provides working with Text File Handles.

Work using Objects - TStringList

Modern Pascal also supports some of the Delphi Language.

There are other ways too

Depending upon your needs, Pascal has you covered.

Program DisplayAFile.v1180922; uses Environment, Datetime, Strings, Display; Procedure UsingStringList(FName:String); var Strlist:TStringList; Begin Strlist.Init; Strlist.LoadFromFile(FName); Writeln(Strlist.getText); Strlist.Free; End; Procedure UsingTextFileHandle(FName:String); var TFH:Text; Ws:String; Begin AssignText(TFH, FName); Reset(TFH); While not EndOfText(TFH) do begin {$I-} Ws:=ReadlnText(TFH); {$I+} Writeln(Ws); End; CloseText(TFH); End; var Ch:Char; Begin ClrScr; Writeln('There are many ways to display a file in Pascal'); Writeln('Pick how you would like to see it done:'); Repeat Writeln(''); Writeln('1. Use TStringList Object.'); Writeln('2. Use Text File Handle.'); Writeln(''); Write('You choice? [ESC to Quit.] '); Ch:=ReadKey; Case Ch of '1':UsingStringList(Paramstr(Paramcount)); '2':UsingTextFileHandle(Paramstr(Paramcount)); End; Until Ch=#27; End.

Output from code above...