Subject: | |
From: | |
Reply To: | |
Date: | Tue, 18 Dec 2001 14:16:34 -0600 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
"David T Darnell" <[log in to unmask]> wrote in message
news:9vnl0u0ood@enews4.newsguy.com...
> >FYI.... Declaring an initial value in a DATA statement in
> >FORTRAN essentially causes the variable to be 'static'
>
> I was completely unaware of this behavior, even after
> recently working nothing but FORTRAN on MPE for 14 months.
> Perhaps it depends on compiler directives?
> Fortran/77 on the HP1000 definitely did not behave this way.
> Perhaps I'll try an experiment.
Watch out for the case where a local variable in a subprogram is given an
initial value in a DATA statement, but then assigned a different value
during execution. Without a SAVE statement, the FORTRAN 77 standard does
not specify what the value will be on the next reference of that subprogram.
I think that HP FORTRAN 77/iX will treat the variable as though it had been
specified in a SAVE statement, but I wouldn't rely on that.
Walter Murray
Hewlett-Packard
Customer Support R&D
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|