FORTRAN 77 Language Reference

Hollerith Constants @

A Hollerith constant consists of an unsigned, nonzero, integer constant, followed by the letter H, followed by a string of printable characters where the integer constant designates the number of characters in the string, including any spaces and tabs.

A Hollerith constant occupies 1 byte of storage for each character.

A Hollerith constant is aligned on 2-byte boundaries.

The FORTRAN standard does not have this old Hollerith notation, although the standard recommends implementing the Hollerith feature to improve compatibility with old programs.

Hollerith data can be used in place of character-string constants. They can also be used in IF tests, and to initialize noncharacter variables in DATA statements and assignment statements, though none of these are recommended, and none are standard. These are typeless constants.

Example: Typeless constants:


	CHARACTER C*1, CODE*2 
	INTEGER TAG*2 
	DATA TAG / 2Hok / 
	CODE = 2Hno 
	IF ( C .EQ. 1HZ ) CALL PUNT

The rules and restrictions on Hollerith constants are: