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.
DATA
◄Up► ◄Contents► ◄Index► ◄Back►
─────DATA───────────────────────────────────────────────────────────────────
Action
Assigns initial values to variables.
Syntax
DATA nlist /clist/ [ [,] nlist /clist/]...
Parameter Description
nlist A list of variables, strings or implicit DO
lists to initialize. Separate list items with
commas.
clist A list of initial values for the items in
<nlist>. Values must be constants or
Hollerith constants, separated by commas.
Remarks
Structure variables may not appear in DATA statements but structure
elements may.
Variables explicitly declared as automatic may not appear in a DATA
statement.
Only local variables, arrays, and array elements can appear in a
DATA statement.
The form of an implied-DO list is as follows:
(dolist, dovar = start, stop [, inc])
Parameter Description
dolist A list of array-element names and implied-DO
lists
dovar An integer variable
start, stop, Integer-constant expressions
inc
For example, the following are implied-DO lists:
(count(i), i = 5, 15, 2)
((array(sub,low), low = 1, 12), sub = 1, 2)
((result(first,second), first = 1, max), second = 1, upper)
The number of iterations and the values of <dovar> are established
from <start>, <stop>, and <inc> the same as for a DO loop except
that the iteration count must be positive. When an implied-DO
list appears in a DATA statement, the list items in <dolist> are
initialized once for each iteration of the implied-DO list.
Examples
INTEGER n, order, alpha, list(100)
REAL coef(4), eps(2), pi(5), x(5,5)
CHARACTER*12 help
DATA n /0/, order /3/
DATA alpha /'A'/
DATA coef /1.0, 2*3.0, 1.0/, eps(1) /.00001/
C The following example initializes diagonal and below in
C a 5x5 matrix:
DATA ((x(j,i), i=1,j), j=1,5) / 15*1.0 /
DATA pi / 5*3.14159 /
DATA list / 100*0 /
DATA help(1:4), help(5:8), help(9:12) /3*'HELP'/
-♦-