home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!elroy.jpl.nasa.gov!nntp-server.caltech.edu!draco.macsch.com!convex.is.macsch.com!dnl
- From: dnl@convex.is.macsch.com (David Lombard)
- Subject: Re: function name as an argument
- Message-ID: <1992Dec12.010450.23241@draco.macsch.com>
- Sender: usenet@draco.macsch.com (Usenet Poster)
- Organization: MacNeal-Schwendler Corp.
- References: <BURLEY.92Dec8185030@apple-gunkies.gnu.ai.mit.edu> <1992Dec10.012254.3535@alchemy.chem.utoronto.ca> <1992Dec10.155427.2271@e2big.mko.dec.com>
- Date: Sat, 12 Dec 92 01:04:50 GMT
- Lines: 39
-
- In article <1992Dec10.155427.2271@e2big.mko.dec.com> lionel@quark.enet.dec.com (Steve Lionel) writes:
- > Indeed, the standard says:
- >
- > If a character function is referenced in a program unit,
- > the function length specified in the program unit must be
- > an integer constant expression.
- >
- > ANSI X3.9-1978, section 15.2, p15-2, lines 5-7
- >
- >Because VAX FORTRAN supports the usage above, we always pass character
- >functions by descriptor, which includes the length. But a standard-conforming
- >program can't do this thus a compiler which chooses not to support this
- >extension can get away without passing the length of character function
- >arguments. (When the function is actually called, the length of the function
- >result does have to be passed, but that's another story.)
- >
-
- If you're going to quote the standard, make sure you're right.
-
- See section 8.4.2 CHARACTER Type-Statement, line 46-:
-
- If a dummy argument has a len of (*) declared, the dummy
- argument assumes the length of the associated actual
- argument for each reference of the subroutine or function.
-
- Thus, in a function or subroutine,
-
- CHARACTER FRED*(*)
-
- is correct (IMHO the _proper_ declaration!).
-
- Regards,
- DNL
-
- MY_COMMENTS = MY_OPINIONS = NOBODY_ELSES;
-
- David N. Lombard The first thing we do, The MacNeal-Schwendler Corp
- dnl@macsch.com Let's kill all the lawyers. 815 Colorado Blvd
- (213) 259-4911 II Henry VI, IV.ii Los Angeles, CA 90041
-