Intel fortran-80 manual Appendix C Hollerith Data Type, C.1 Hollerith As A Data Type

Models: fortran-80

1 130
Download 130 pages 742 b
Page 107
Image 107
APPENDIX C

APPENDIX C

HOLLERITH DATA TYPE

The Hollerith data type is a carryover from FORTRAN 66. Generally speaking, the character data type provides a superior processing capability, and Hollerith has been retained in FORTRAN-80 primarily for compatibility with the earlier standard.

C.1 Hollerith As A Data Type

Although Hollerith is a data type, a symbolic name cannot be of type Hollerith. Hollerith data (other than Hollerith constants) are identified under the guise of an integer, real, or logical type name. It cannot be identified as type character.

Integer, real, or logical items can be defined with a Hollerith value using either the DATA or READ statements. Totally associated items then become associated with that Hollerith value also. When such a definition occurs, the defined item loses its integer, real, or logical characteristic.

C.2 The Hollerith Constant

The format of a Hollerith constant is

where 'n' is a nonzero, unsigned, integer constant and 'h' is any character represen- table in the processor. Blanks are significant in the character string following the

'H.'

Hollerith constants can appear only in a DATA statement and in the argument list of a CALL statement.

C.2.1 Hollerith Constants In DATA Statements

AHollerith constant may appear in the 'elist' of a DATA statement; the correspon- ding entity in 'nlist' must have type integer, real, or logical.

Foran. entity ()~t~pein:t~8~r, real, or logi9al,t?e~umbe~?fcharacters'Il'in the COP

responding Holleritnconstantmust belesstllanoreql;1{l:l to'~~'~here'g!.. ~s.the

len~thofthe~t{)r3'~e~~it()f:the ~ntity;·If 'n; j~ less thal1~.p,'t~~el'tityis jniti~lized with the ~n'Hollepithch~rfl;ctersextended.ontherjghtwith 'g~ntljlank characters.

Each Hollerith constant initializes exactly one variable or array element.

C.2.2 Hollerith Constants In CALL Statements

An actual argument in a CALL statement can be a Hollerith constant, so long as the corresponding dummy argument has type integer, real, or logical. This is an excep- tion to the rule that actual and dummy arguments must agree in type.

C-l

Page 107
Image 107
Intel fortran-80 manual Appendix C Hollerith Data Type, C.1 Hollerith As A Data Type, C.2 The Hollerith Constant