fileprnt.icn: Program to display characters in file

November 21, 1989; Ralph E. Griswold
Requires: co-expressions
This file is in the public domain.
   This program reads the file specified as a command-line argument and
writes out a representation of each character in several forms:
hexadecimal, octal, decimal, symbolic, and ASCII code.

   Input is from a named file rather than standard input, so that it
can be opened in untranslated mode.  Otherwise, on some systems, input
is terminated for characters like ^Z.

   Since this program is comparatively slow, it is not suitable
for processing very large files.

   There are several useful extensions that could be added to this program,
including other character representations, an option to skip an initial
portion of the input file, and suppression of long ranges of identical
characters.
____________________________________________________________

Program note:

   This program illustrates a situation in which co-expressions can be
used to considerably simplify programming.  Try recasting it without
co-expressions.

Source code | Program Library Page | Icon Home Page