Info Byte: FORTRAN & DATA
The primary purpose of the DATA
statement is to give names to constants; instead of referring to pi as 3.141592653589793... at every appearance, the variable PI
can be given that value with a DATA
statement and used instead of the longer form of the constant.
This also simplifies modifying the program, should the value of pi change.
FORTRAN manual for Xerox Computers
Written by Rashaad Essop
Related protips
4 Responses
Thanks for the bit :)
Isn't the same accomplished with PARAMETER statement?
Or does it have some advantages to it?
Good question. I think you may well be right. FORTRAN is not really my...uh, forte :)
I think this is from the editions of the language around '77', '66' or one or two before it. I'm not sure why, but it would appear that the "DATA" statement is obsolete (http://goo.gl/I9ISp), I'm guessing the PARM statement is of its successors.
See also (http://goo.gl/gaTPj)
Yup, it's obsolete alright.
F90 didn't have it actually removed, rather marked as "obsolescent", meaning it for future removal.
Cool. I just find the history of computing, logic systems and computer systems in general quite interesting.
I read also that 'FORTRAN' is now stylized as simply 'Fortran' - but you probably knew that I presume. If not, another 'info byte' for you there ;)