Declares entities
of type integer.
Syntax
BYTE [[, attrib-list] ::] entity-list |
- attrib-list
is a comma-separated list of one or more of the
following attributes:
Table 10-3 Title not available (BYTE (extension))
ALLOCATABLE | INTRINSIC | PRIVATE |
DIMENSION | OPTIONAL | PUBLIC |
EXTERNAL | PARAMETER | SAVE |
INTENT | POINTER | TARGET |
If attrib-list is present, it must be followed by the double colon.
For information about individual attributes, see the corresponding
statement in this chapter.
- entity-list
is a list of entities, separated by commas. Each
entity takes the form:
name [( array-spec )] [= initialization-expr] |
where:
name
is the name of a variable or function
array-spec
is a comma-separated list of dimension bounds
initialization-expr
is a integer constant integer expression. If initialization-expr is present, entity-list must be preceded by the double colon.
Description
The BYTE statement is an HP extension that is used to declare
the properties of entities. The entities can take values that are
whole numbers and can be represented in one byte. It is equivalent
to the INTEGER(KIND=1) statement.
The BYTE statement is constrained by the rules for all
type declaration statements, including the requirement that it precede
all executable statements. Note, however, that the BYTE statement does not have a kind parameter.
Example
The following are valid declarations:
BYTE i, j BYTE :: k BYTE, PARAMETER :: limit=120 ! use an array constructor to initialize an array BYTE, DIMENSION(4) :: bvec=(/1,2,3,4/) ! use slashes as initialization delimiters, an HP extension BYTE b/12/, bb/27/ ! note, no double colon
|
Related statements
INTEGER
Related concepts
For related information, see the following: