FORTRAN Reference Manual

FORTRAN Reference Manual528615-001
H-1
H
Hollerith Constants and Punch Card
Codes
Topics covered in this section include:
A Hollerith string defines a constant character string. Hollerith data was widely used to
represent character strings prior to FORTRAN 77.
The form of a Hollerith constant is:
n
is an unsigned, nonzero integer constant that specifies the number of characters in
string.
string
is a string of n characters.
In HP FORTRAN, you can use Hollerith constants as:
Actual parameters to subprograms
Constant strings in FORMAT statements
Input values that you read with a READ statement
Initialization values in DATA statements
The following Hollerith constant specifies a string of four characters; the characters are
NEWS:
4HNEWS
The following Hollerith constant specifies a string of eight characters; the characters
are ++DATE++
8H++DATE++
Blank characters in a Hollerith constant are significant.
If you specify a Hollerith constant as an actual parameter in a CALL statement, the size
of the Hollerith constant must be appropriate to the data type of the subprogram’s
Topic Page
Editing Hollerith Data
H-2
Hollerith Constants as Subprogram Arguments H-3
Hollerith Punch Card Codes H-3
nHstring