DECLARE statement
The
DECLARE statement specifies some or all of the attributes of a name.
If the attributes are not explicitly declared and cannot be determined
by context, default attributes are applied.
DECLARE statements can be an important part of the documentation
of a program. Consequently, you can make liberal use of declarations,
even when default attributes suffice or when an implicit declaration
is possible. Because there are no restrictions on the number of
DECLARE statements, you can use different DECLARE statements for different
groups of names. Any number of names can be declared in one DECLARE statement.
 .-,-------------------------------------------.
| .--------------------. |
V V | |
>>-DECLARE----+-------+--+-name-+----+----------------+-+-+----->
'-level-' '-*----' '-| attributes |-'
.------------------------------.
V |
>--;--| attributes: |----+-data-attributes----------+-+--------><
+-alignment-attributes-----+
+-scope-attributes---------+
+-storage-attributes-------+
'-complementary-attributes-'
|
Abbreviation: DCL
For more information about declaring arrays, structures, and
unions, refer to Arrays, Structures, or Unions.
- *
- Cannot be used as the name of an INTERNAL or an EXTERNAL scalar or as the name of a level-1 EXTERNAL structure or union unless the EXTERNAL attribute specifies an environment name (see INTERNAL and EXTERNAL attributes).
- attributes
- The attributes can appear in any order.
All attributes given explicitly for the name must be declared
together in a DECLARE statement, except that:
- Names having the FILE attribute can also be given attributes
in an OPEN statement (or have attributes implied by an implicit
opening). For more information on the OPEN statement, see OPEN statement.
- The parameter attribute is contextually applied by the appearance
of the name in a parameter list. A DECLARE statement internal to
the block can specify additional attributes.
Attributes of external names, in separate blocks and compilations,
must be consistent.
For more information about attributes and the members of the
given groups, refer to Data types and attributes.
- level
- A nonzero integer. If a level-number is not specified, level 1 is
the default for element and array variables. Level 1 must
be specified for major structure and union names.
- name
- Each level-1 name must be unique within a block. For more
information on level-1 names, refer to Structures.
Condition prefixes and labels cannot be specified on a DECLARE
statement.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)