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

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!data.nas.nasa.gov!mustang.mst6.lanl.gov!nntp-server.caltech.edu!draco.macsch.com!convex.is.macsch.com!dnl
  3. From: dnl@convex.is.macsch.com (David Lombard)
  4. Subject: Re: Obscure fortran question
  5. Message-ID: <1992Dec23.224608.14985@draco.macsch.com>
  6. Sender: usenet@draco.macsch.com (Usenet Poster)
  7. Organization: MacNeal-Schwendler Corp.
  8. References: <tubetf0@sgi.sgi.com>
  9. Date: Wed, 23 Dec 92 22:46:08 GMT
  10. Lines: 40
  11.  
  12. In article <tubetf0@sgi.sgi.com> rutt@paradise.mti.sgi.com writes:
  13. >
  14. >
  15. >      i = 10
  16. >      do 240 i = 1, identity(i)
  17. >
  18.  
  19. In my reading, the value of the expression `identity(i)' should be
  20. determined _before_ the DO-variable is defined.  See 11.10.3 (pg 11-7):
  21.  
  22.     11.10.3 Executing a DO statement.  The effect of executing
  23.     a DO statement is to perform the following steps in
  24.     sequence:
  25.  
  26.        (1)    The initial parameter m1, the terminal parameter m2,
  27.         and the incrementation parameter m3 are established
  28.         by evaluating e1, e2, and e3, respectively,
  29.         including, if necessary, conversion to the tyupe of
  30.         the DO-variable according to the rules...
  31.  
  32.        (2)    The DO-variable becomes defined with the value of the
  33.         initial parameter m1.
  34.  
  35.        (3)    The iteration count is established and is the value 
  36.         of the expression
  37.  
  38.         ...
  39.  
  40. So, since step (1), the evaluation of the control parameters, must 
  41. precede step (2), the assignment of the DO-variable, identity(10)
  42. should have been executed in step (1).
  43.  
  44. Regards,
  45. DNL
  46.  
  47.                  MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;
  48.  
  49. David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
  50. dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
  51. (213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
  52.