Intel fortran-80 Laptop User Manual


 
Defining Variables, Arrays,
And
Memory
3-10
The
ASSIGN
statement
has
the
format:
ASSIGN
stlTO
name
where
stl
is
a
statement
label (1-5 digits)
name
is
an
integer variable
name
The
statement
label
must
be the label
of
an
executable
statement
or
a
FORMA
T
statement
in the
same
program
unit
as the
ASSIGN
statement.
The
variable
'name'
must
not
be
declared as length
INTEGER
*
1.
An integer variable defined with a
statement
label value
may
be redefined with
the
same
or
a
different
statement
label value, as well as with
an
integer value.
Examples:
ASSIGN 1010 TO LOOP1
GOTO
LOOP1
GO TO LOOP1(1000, 1010, 1020)
IF(.NOT.DONE)
THEN
ASSIGN 20 TO WRFORM
ELSE
ASSIGN 25 TO WRFORM
ENDIF
WRITE (6,WRFORM) PNAME, AVG
20 FORMAT
..
.
25 FORMAT
..
.
3.3.5 DATA Statement
The
DATA
statement
gives the initial values
of
variables, arrays,
and
array
clements.
Dummy
arguments
and
functions
cannot
be initialized by
DATA.
Shared,
or
'common,'
memory
can be initialized by
DATA
statements
if
the
DATA
statements
are
part
of
a
BLOCK
DATA
subprogram
(section 3.4.3).
The
DATA
statement
must
appear
in a
program
unit
after
the specification
statements
and
before
any
statement
function
or
executable
statements.
The
DATA
statement
has the
format:
DATA
nlist
felistl [[,]
nlist
felistl] ...
where
'nlist'
is
a list
of
variable
names,
array
names,
and
array
element
names,
and
'clist'
has
the
form:
[r*]c[,[r*]c] ...
where
c
is
a
constant
(including a
Hollerith
constant)
r
is
a
'repeat'
character
and
is
a
nonzero,
unsigned, integer
constant;
'r*c'
is
equivalent
to
Or'
successive repetitions
of
the
constant
'c.'
FORTRAN-80