1 Introduction

The Fortran 77 standard provides a data type for the storage of character strings (the type CHARACTER), an operator specific to character data (the // operator for string concatenation), and eight intrinsic functions specifically for handling CHARACTER typed variables (CHAR, ICHAR, INDEX, LEN, LGE, LGT, LLE, LLT). Facilities to write and read Fortran data types to and from character strings (using internal files and the WRITE and READ statements respectively) are also provided by the Fortran 77 standard. Although these features of the Fortran language are of considerable utility when handling character variables in Fortran programs, they constitute only the basic tools for the more extensive processing of textual data sometimes required in applications.

The CHR library augments the limited character handling facilities provided by the Fortran 77 standard. It offers a range of character handling facilities: from formatting Fortran data types into text strings and the reverse, to higher level functions such as wild card matching, string sorting, paragraph reformatting and justification. The library may be used simply for building text strings for interactive applications or as a basis for more complex text processing applications.

The functions performed by the CHR library may be categorised as follows:

A classified list of of these routines is given in Appendix B.

Equivalent functions written entirely in C are available for a subset of the CHR routines (see Appendix D). These are provided mainly for use when porting Fortran application code to C.