home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4671 < prev    next >
Encoding:
Text File  |  1992-12-11  |  2.0 KB  |  51 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!elroy.jpl.nasa.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: function name as an argument
  5. Message-ID: <1992Dec12.010450.23241@draco.macsch.com>
  6. Sender: usenet@draco.macsch.com (Usenet Poster)
  7. Organization: MacNeal-Schwendler Corp.
  8. References: <BURLEY.92Dec8185030@apple-gunkies.gnu.ai.mit.edu> <1992Dec10.012254.3535@alchemy.chem.utoronto.ca> <1992Dec10.155427.2271@e2big.mko.dec.com>
  9. Date: Sat, 12 Dec 92 01:04:50 GMT
  10. Lines: 39
  11.  
  12. In article <1992Dec10.155427.2271@e2big.mko.dec.com> lionel@quark.enet.dec.com (Steve Lionel) writes:
  13. >                                     Indeed, the standard says:
  14. >
  15. >    If a character function is referenced in a program unit,
  16. >    the function length specified in the program unit must be
  17. >    an integer constant expression.
  18. >
  19. >            ANSI X3.9-1978, section 15.2, p15-2, lines 5-7
  20. >
  21. >Because VAX FORTRAN supports the usage above, we always pass character
  22. >functions by descriptor, which includes the length.  But a standard-conforming
  23. >program can't do this thus a compiler which chooses not to support this
  24. >extension can get away without passing the length of character function
  25. >arguments.  (When the function is actually called, the length of the function
  26. >result does have to be passed, but that's another story.)
  27. >
  28.  
  29. If you're going to quote the standard, make sure you're right.
  30.  
  31. See section 8.4.2 CHARACTER Type-Statement, line 46-:
  32.  
  33.     If a dummy argument has a len of (*) declared, the dummy
  34.     argument assumes the length of the associated actual
  35.     argument for each reference of the subroutine or function.
  36.  
  37. Thus, in a function or subroutine,
  38.  
  39.     CHARACTER FRED*(*)
  40.  
  41. is correct (IMHO the _proper_ declaration!).
  42.  
  43. Regards,
  44. DNL
  45.  
  46.                  MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;
  47.  
  48. David N. Lombard    The first thing we do,         The MacNeal-Schwendler Corp
  49. dnl@macsch.com      Let's kill all the lawyers.    815 Colorado Blvd
  50. (213) 259-4911      II Henry VI, IV.ii             Los Angeles, CA  90041
  51.