Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!brutus.cs.uiuc.edu!apple!vsi1!daver!ditka!zinn!ubbs-nh!siia!wje From: wje@siia.mv.com (Bill Ezell) Newsgroups: comp.lang.fortran Subject: Fortran functions Message-ID: <1990Jan30.191039.12165@siia.mv.com> Date: 30 Jan 90 19:10:39 GMT Distribution: na Organization: Software Innovations, Inc. Lines: 32 After a long interval (18 years!) of not having looked at Fortran, I have had to work on some VMS Fortran recently. I came across a situation where I'm not sure how the compiler figures out what's going on. The program does the following: character*5 foo character*5 ans ans = foo(arg) where foo is a function, not in the same file. Foo is not declared external. 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. In the case above, arg was a character*80, so does the compiler infer that foo() is a function call from the fact that a character string can't be a subscript? If so, what if the call had been of the form ans = foo(1) or some such? Also, is there any difference between: character*5 var character var*5 character var(5) Eagerly awaiting enlightenment.... -- Bill Ezell Software Innovations, Inc. wje@siia.mv.com (603) 883-9300