HEAD Tool Sourcecode#

PROGRAM Head;
(*
  by Erik C. Warren, 14 January, 1987
  for UPDATE...KYAN's Jan./Feb. issue
*)
 TYPE
     PathString = ARRAY~[1..15] OF Char;
  VAR
        fn : PathString;
     nl,lr : Integer;
       inf : Text;
BEGIN
  Write('head file : ');
    ReadLn(fn);
  Write('# of lines: ');
    ReadLn(nl);
  Reset(inf,fn);
  Write(inf^);
  FOR lr := 2 TO nl DO
  BEGIN
    Get(inf);
    Write(inf^);
    WHILE NOT EOLn(inf) DO
    BEGIN
      Get(inf);
      Write(inf^)
    END; (* WHILE inf *)
    WriteLn
  END; (* FOR lr *)
  WriteLn;
  WriteLn(nl,' lines typed from ',fn)
END. (* PROGRAM *)

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 03-Feb-2023 16:21 by Carsten Strotmann  
G’day (anonymous guest) My Prefs
© 2010-2021 AtariWiki
All content in the Wiki is licensed under Creative Commons Share Alike License, unless otherwise noted.
JSPWiki v2.8.3