home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / fortran / 4841 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.3 KB  |  38 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!umn.edu!csus.edu!netcom.com!walt
  3. From: walt@netcom.com (Walt Brainerd)
  4. Subject: Re: Obscure fortran question
  5. Message-ID: <1992Dec23.001321.5581@netcom.com>
  6. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  7. References: <tubetf0@sgi.sgi.com>
  8. Date: Wed, 23 Dec 1992 00:13:21 GMT
  9. Lines: 27
  10.  
  11. In article <tubetf0@sgi.sgi.com>, "John C. Ruttenberg" <rutt@paradise.mti.sgi.com> writes:
  12. > Suppose the do variable is assigned above the loop and used in the second
  13. > expression of a do.  Should its value there be:
  14. >     1. Its value above the loop, or
  15. >     2. The value of the first expression in the do?
  16. 1 is the correct answer.  The standard (Fortran 90) says that
  17. step one of executing a do loop is to evaluate the expressions
  18. for the initial value, terminal value, and increment (if any).
  19. Step two is two initialize the DO variable.
  20.  
  21.    i=10
  22.    do i = 1,i
  23.      ...
  24. is executed 10 times.
  25.  
  26. The words in the Fortran 77 standard are similar, I am sure,
  27. but I didn't check it.
  28. -- 
  29. Walt Brainerd                walt@netcom.com
  30. Unicomp, Inc.                +1-415-949-4052
  31. 235 Mt. Hamilton Ave.        +1-415-949-4058 (fax)
  32. Los Altos, CA 94022 USA      "F90--Fortran for the '90s"
  33.