Modula-2 Reloaded

A Modern Typesafe & Literate Programming Notation

Site Menu

Project

Specification

Implementation

Recommendations

Reference

Needs Updating

Work in Progress

Wastebasket

Wiki Manual

edit SideBar

IO Module UNICHAR

Spec.IOModuleUNICHAR History

Hide minor edits - Show changes to output

2010-05-24 12:46 by benjk -
Changed lines 3-4 from:
(* File based I/O for type UNICHAR *)
to:
(* I/O Module for Type UNICHAR *)
Changed lines 7-18 from:
PROCEDURE Read( infile : File; VAR ch : UNICHAR );
(* Attempts to read a UNICHAR character from input stream infile and, if successful,
  assigns the corresponding value to ch.  The file status of
infile is set accordingly
  to any
of allRight, endOfLine, or endOfInput. *)

PROCEDURE Write( outfile : File; ch : UNICHAR );
(* Writes character ch
to output stream outfile, unformatted. *)

PROCEDURE WriteF( outfile : File; fmtStr : ARRAY OF UNICHAR; items : CARDINAL;
         
        VARIADIC v[items] OF ch : UNICHAR );
(* Writes a formatted textual representation of one or more UNICHAR values to output stream outfile. The value
 
  of parameter items is calculated and inserted automatically. The output format is determined by fmtStr. *)
to:
PROCEDURE Read ( infile : File; VAR ch : UNICHAR );
(* Reads a UNICHAR value from stream infile
  - any leading whitespace is skipped
  - the character being read is removed from
infile
   - the code point of the character value read is assigned to ch
  - the file status is set
to any of:
 
   success, outOfRange, wrongFormat, endOfLine, or endOfInput. This
  procedure is substituted for invocations of READ with a UNICHAR argument.*)

PROCEDURE Write ( outfile : File; ch : UNICHAR );
(* Writes the textual representation of
UNICHAR ch to stream outfile. This
  procedure is substituted for invocations of WRITE with a UNICHAR argument.*)

PROCEDURE WriteF ( outfile      : File;
                  CONST fmtStr : ARRAY OF CHAR;
                  items        : VARIADIC OF UNICHAR );
(* Writes a formatted textual representation of one or more UNICHAR values to
  output stream outfile. The output format is determined by fmtStr. This
  procedure is substituted for invocations of WRITEF with one or more
  UNICHAR arguments
. *)