HP Fortran Programmer's Reference (September 2007)

HP Fortran statements
INTEGER
Chapter 10386
array-spec
is a comma-separated list of dimension bounds
initialization-expr
is an integer constant expression. If
initialization-expr
is present,
entity-list
must be preceded by the double colon.
Description
The INTEGER statement is used to declare the length and properties of data that are whole
numbers. A kind parameter (if present) indicates the representation method.
The INTEGER statement is constrained by the rules for all type declaration statements,
including the requirement that it precede all executable statements.
As a portability extension, HP Fortran allows the following syntax for specifying the length of
an entity:
name
[*
len
] [(
array-spec
)] [=
initialization-expr
]
If (
array-spec
) is specified, *
len
may appear on either side of (
array-spec
). If
name
appears with *
len
, it overrides the length specified by INTEGER*
size
.
Examples
The following are valid declarations:
INTEGER i, j
INTEGER(KIND=2) :: k
INTEGER(2), PARAMETER :: limit=420
! initialize an array, using an array constructor
INTEGER, DIMENSION(4) :: ivec = (/1, 2, 3, 4 /)
! use the slash notation (an HP extension) to initialize
INTEGER i/-1/, j/-2/, k/-7/ ! note, no double colon
! the following declarations are equivalent; the second uses the
! HP length specification extension
INTEGER (KIND = 8) int1
INTEGER*4 int1*8
Related statements
BYTE
Related concepts
For related information, see the following:
“Type declaration for intrinsic types” on page 109