Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!hcx1!hcx2!bill From: bill@hcx2.SSD.HARRIS.COM Newsgroups: comp.lang.fortran Subject: Re: Question on DATA and SAVE. Message-ID: <44400032@hcx2> Date: 31 Jan 89 18:56:00 GMT References: <2482@garth.UUCP> Lines: 25 Nf-ID: #R:garth.UUCP:2482:hcx2:44400032:000:1062 Nf-From: hcx2.SSD.HARRIS.COM!bill Jan 31 13:56:00 1989 As far as X3.9-1978 goes, the answer is somewhat complicated. See page 8-11, lines 35-50. What this says is that, if the variable has never been defined or become undefined, it still retains the DATA value. But once you assign to it or otherwise make it become undefined (like passing it as an actual to a dummy that might, or might not, be redefined), then it (the DATA variable) becomes undefined upon executing a RETURN or END. Remember that "undefined" in the Standard means that you can't count on its value. It does NOT mean that the value has necessarily changed. As far as practicality goes, this program is non-portable. There are some implementations that execute such a DATA statement, where the variable is not SAVEd, each time the procedure is entered. Others do not. Note that the current draft 8x standard says that DATA implies the SAVE attribute; FORTRAN/77 did not say that. Bill Leonard Harris Computer Systems Division 2101 W. Cypress Creek Road Fort Lauderdale, FL 33309 bill@ssd.harris.com or bill%ssd.harris.com@eddie.mit.edu