Array Constructors



Hello,

Can anyone confirm that when a variable is used in an implied do loop
in an array constructor, is its value always restored afterwards. For
example, if I do:


integer :: i
integer :: XYZ(8)
call date_and_time(values = XYZ)

i = 42
write (*,"(I5)") i
write (*,"(8I5)") (/(XYZ(i),i=1,8)/)
write (*,"(I5)") i

will the last line written always be 42. Intuitively, it felt like it
should be, as I would hope that the two i's are total separate.
However, IVF complained if the variable used in the array constructor
had not been declared (with implicit none set). It does works with
IVF, but I can't see anything in the documentation that states this
must always be the case.

Chris

.



Relevant Pages

  • Re: Array Constructors
    ... Can anyone confirm that when a variable is used in an implied do loop ... IVF complained if the variable used in the array constructor ... but I can't see anything in the documentation that states this ... I always thought implied do-loops ...
    (comp.lang.fortran)
  • Re: Evaluate a multidimensional array using implied Do loop
    ... do loop with a implied do loop? ...   end do ... and I've used the f2003 array constructor syntax because this is ...
    (comp.lang.fortran)
  • Re: Evaluate a multidimensional array using implied Do loop
    ... do loop with a implied do loop? ... trying for an entry in an obfuscated code contest, ... and I've used the f2003 array constructor syntax because this is ...
    (comp.lang.fortran)
  • Re: Adding new methods to existing classes
    ... It would appear the prototype registers but it's not recognizing it's own ... attributes and never iterates thru them and ultimately hits return false. ... Changing from a for..in loop to a regular for loop makes no difference. ... Use, not the Array constructor. ...
    (comp.lang.javascript)
  • Re: Evaluate a multidimensional array using implied Do loop
    ... do loop with a implied do loop? ... statements, and array constructors. ... more cryptic when you try to turn it into an array assignment. ... and I've used the f2003 array constructor syntax because this is ...
    (comp.lang.fortran)