From Modula-2 Reloaded

Spec: Text IO

DEFINITION MODULE TextIO;

(* Driver for Line Oriented Text IO *)

(* This module interprets the contents of files as a sequence of lines of text
   delimited by newline. The module is implemented on top of module FileIO. *)

FROM FileIO IMPORT File;


(* Read a line of text *)

PROCEDURE ReadLine ( file : File; VAR str : ARRAY OF CHAR );
(* Reads a line of text from <file> and passes it back in <str>. A runtime
   error is raised if the line exceeds the capacity of <str>. *)


(* Skip a line of text *)

PROCEDURE SkipLine ( file : File );
(* Read and ignore all characters up to and including the first newline. *)


(* Write a line of text *)

PROCEDURE WriteLine ( file : File; str : VARIADIC OF CONST ARRAY OF CHAR );
(* Writes a sequence of character strings as a line to <file>. The line is
   terminated by newline. *)


(* Write an empty line of text *)

PROCEDURE WriteLn ( file : File );
(* Writes an empty line to <file>. The line is terminated by newline. *)

END TextIO.
Retrieved from http://modula-2.net/m2r10/pmwiki.php?n=Spec.TextIO
Page last modified on 2010-05-24 12:32