Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!spdcc!esegue!johnl From: johnl@esegue.segue.boston.ma.us (John R. Levine) Newsgroups: comp.lang.fortran Subject: Re: Fortran functions Message-ID: <1990Feb2.040750.2578@esegue.segue.boston.ma.us> Date: 2 Feb 90 04:07:50 GMT References: <1990Jan30.191039.12165@siia.mv.com> Reply-To: johnl@esegue.segue.boston.ma.us (John R. Levine) Distribution: na Organization: Segue Software, Cambridge MA Lines: 19 In article <1990Jan30.191039.12165@siia.mv.com> wje@siia.mv.com (Bill Ezell) writes: > character*5 foo > character*5 ans > ans = foo(arg) > >My question is, how does it know that the use of foo is a function call, >and not a subscript operation? It seems that this is rather ambiguous. It's not ambiguous at all. All arrays have to be dimensioned, either in dimension statements or in common or data typing statements. If it's not dimensioned, it's not an array and is either a scalar or a function, depending on whether you call it or not. Although declaring functions to be external is an excellent idea, you only need to do so in two cases: when passing a function name as an argument to another function or subroutine, and when the function name collides with an intrinsic. -- John R. Levine, Segue Software, POB 349, Cambridge MA 02238, +1 617 864 9650 johnl@esegue.segue.boston.ma.us, {ima|lotus|spdcc}!esegue!johnl "Now, we are all jelly doughnuts."