INTEGER Statement (Nonexecutable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation
HP FORTRAN 77/iX Reference
INTEGER Statement (Nonexecutable)
The INTEGER statement is a type specification statement that explicitly
assigns the INTEGER*2 and INTEGER*4 data types to symbolic names, and
optionally assigns initial values to variables.
The following syntax includes the INTEGER, INTEGER*2, and INTEGER*4
statements.
Semantics
As an extension to the ANSI 77 standard, a length specifier can follow
the item being declared. This specification overrides the length implied
by the type statement. If the item being declared is an array name with
a dimension declarator, the length specifier precedes the dimension
declarator.
The INTEGER*2 statement, an extension to the ANSI 77 standard, declares
items to be 2-byte integers. The INTEGER*4 statement, also an extension
to the ANSI 77 standard, declares items to be 4-byte integers.
NOTE By default, the INTEGER statement is equivalent to the INTEGER*4
statement. This is the same as the effect of the LONG compiler
directive. The SHORT compiler directive may be used to make
INTEGER equivalent to INTEGER*2. See Chapter 7 for further
details. In addition, compiler run-string options can have the
same effect. See Chapter 7, "Compiler Directives" for further
details.
If an array declarator is specified in a type statement, the declarator
for that array must not appear in any other specification statement (such
as DIMENSION). If only the array name is specified, an array declarator
must appear within a DIMENSION or COMMON statement.
Each symbolic name can appear in a type statement only once.
Examples Notes
---------------------------------------------------------------------------------------
INTEGER run,time The variables run and time are 4-byte
integers.
INTEGER*2 rn,hours(4,5) The variable rn and each element of the
two- dimensional array hours are short
integers.
INTEGER counter*2,index*4,matx(4,5)*2 The variable counter and each element of
the two-dimensional array matx are short
integers. index is a long integer.
MPE/iX 5.0 Documentation