The data statement is an non-executable statement.
In some programs it is desirable to "pre-load" certain values into variables. The data statement provides a way to do this for all variable types. Unlike the PARAMETER statement, any variable declared in a data statement can have its value changed later in the program.
From this you can see the only things that are required with the data statement are some variables ( they can be arrays or scalars in any data type), and a string of values to be assigned that are enclosed be to forward slashes.
To preload values for two INTEGER variables:
To load an array with values:
Where the final assignment 5*0. means take the next 5 elements and pre-load the value of zero.
Now to assign an initial value to a character variable called string, of length 15.
data string/'example '/
Notice that when the value is loaded, the full length of the variable must be filled out with spaces.
lectures six, nineteen, twenty five
examples: arith.f and grades1.f
Written by Jason Wehr : email@example.com and Maintained by John Mahaffy : firstname.lastname@example.org