Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
BLOCK DATA
◄Up► ◄Contents► ◄Index► ◄Back►
─────BLOCK DATA ────────────────────────────────────────────────────────────
Action
Identifies a block-data subprogram, where variables and array
elements in named common blocks can be initialized.
Syntax
BLOCK DATA [blockdataname]
Parameter Description
blockdataname A unique global name for the subprogram.
Remarks
The BLOCK DATA statement must be the first statement in a
block-data subprogram.
Only one unnamed block-data subprogram may appear in an
executable program.
The following restrictions apply:
■ The only statements that may be used in a block-data
subprogram are BLOCK DATA, COMMON, DATA, DIMENSION, END,
END MAP, END STRUCTURE, END UNION, EQUIVALENCE, IMPLICIT,
MAP, PARAMETER, RECORD, SAVE, STRUCTURE, UNION, and type
statements. No executable statements are permitted.
■ Only an entity defined in a named common block may be initially
defined in a block-data subprogram.
■ All the constituents of a named common block must be specified
in that block-data subprogram, even if not all of the
constituents are initialized.
Examples
C The following block-data subprogram initializes
C the named common block /greatlakes/:
C
INTEGER*2 erie, huron, michigan, ontario, superior
BLOCK DATA Lakes
COMMON /greatlakes/ erie, huron, michigan, ontario, superior
DATA erie, huron, michigan, ontario, superior /1, 2, 3, 4, 5/
END
C
C Using the same common block, /greatlakes/, the
C following block-data subprogram is NOT allowed;
C not all the members of /greatlakes/ are specified.
BLOCK DATA GrLaks
COMMON /greatlakes/ erie, huron, ontario, superior
DATA erie, huron, ontario, superior /1, 2, 4, 5/
END
-♦-