Glenn Carver asked:
> function test
> integer :: test
>
>I was puzzled why it is necessary to have instead:
>
> function test()
> integer :: test
[...]
>The () on the function statement seem completely redundant so why have
In fixed source form (thus insignificant blanks),
REAL FUNCTION TEST
is indistinguishable from
REAL FUNCTIONTEST
and so a compiler would not be able to distinguish between an unnamed main
program whose first line declared the variable "FUNCTIONTEST" and a function
with no arguments.
Thus the empty parentheses are required.
This is a requirement from Fortran 77.
Cheers,
--
...........................Malcolm Cohen, NAG Ltd., Oxford, U.K.
([log in to unmask])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|