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!linus!philabs!cmcl2!seismo!hao!woods From: woods@hao.UUCP (Greg Woods) Newsgroups: net.lang.f77 Subject: Re: when is a function not a function... Message-ID: <1562@hao.UUCP> Date: Fri, 24-May-85 12:46:30 EDT Article-I.D.: hao.1562 Posted: Fri May 24 12:46:30 1985 Date-Received: Sat, 25-May-85 09:25:08 EDT References: <10964@brl-tgr.ARPA> Distribution: net Organization: High Altitude Obs./NCAR, Boulder CO Lines: 25 > c This might just be unique to the UNIX(tm) compiler, > c or is it standard that functions can be CALLed > c and subroutines be (almost) treated as functions? > PROGRAM main > CALL func1 > dummy = sub1() > PRINT*,sub1() > END You can do this, since as Doug Gwyn points out, this mis-usage is difficult to detect. In fact, calling a function with a call statement is a convenient way of invoking a function and ignoring the return value. The other example (using a subroutine like a function) will, of course, result in an unpredictable return value which may vary from one machine to another or even one compiler to another on the same machine. --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..."