Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hao.UUCP Path: utzoo!utcs!lsuc!pesnta!hplabs!hao!woods From: woods@hao.UUCP (Greg Woods) Newsgroups: net.lang.f77 Subject: Re: Function returns Message-ID: <1558@hao.UUCP> Date: Thu, 23-May-85 18:40:21 EDT Article-I.D.: hao.1558 Posted: Thu May 23 18:40:21 1985 Date-Received: Sat, 25-May-85 21:15:20 EDT References: <418@gitpyr.UUCP> Distribution: net Organization: High Altitude Obs./NCAR, Boulder CO Lines: 22 > ok...time for a stupid question for any of you guys out there with a > Standard Fortran ( as in ANSI ) definition handy... > > Do functions return the first or the last value assign to them? > - Scott The function name, within a function, is just a pointer to a location in memory. When something is assigned to the function name variable, it is loaded into that location. When a return statement is executed, the value in that location is the function returned value. Thus, the *last* value assigned to the function name variable before execution of a return statement is the returned value. --Greg -- {ucbvax!hplabs | allegra!nbires | decvax!noao | harpo!seismo | ihnp4!noao} !hao!woods CSNET: woods@NCAR ARPA: woods%ncar@CSNET-RELAY "...I may not be right but I've never been wrong It seldom turns out the way it does in the song..."