Re: Syntax for passing an external function into a contained function?



ferrad wrote:
> Still get the unresolved external. (Apologes for the real*8...) I
> have now:
> subroutine sub1(func)
> real*8, external :: func ! put the declaration here !!!
> x = func1(n)
> ...
> contains
> real*8 function func1(n)
> func1 = func(n)
> return
> end

See above. The internal procedure gets the declaration
of FUNC by host association and should not declare
FUNC itself.

--
J. Giles

"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare


.



Relevant Pages

  • Re: external procedure
    ... real, external:: func ... specify func in the main program as external. ... declaration in the main program overrides the declaration in ... no deficiencies and the other way is to make it so complicated ...
    (comp.lang.fortran)
  • Re: Syntax for passing an external function into a contained function?
    ... The internal procedure gets the declaration ... > FUNC itself. ... not refer to the dummy argument, but instead to an external of that name ...
    (comp.lang.fortran)
  • Re: Seed7 Release 2007-05-07
    ... end for is func ... This syntax declaration specifies the keywords, ... need to be executed at compile time. ... although the nice thing about iterators is that they separate ...
    (comp.lang.misc)
  • Re: How to eliminate multiple declaration error for a symbol present in both libs( without modifyin
    ... common function func(). ... gcc -o app libFirst.a libSecond.a app.c. ... It givesmultiple declaration error. ... way to tell the linker which func() declaration it must select. ...
    (comp.lang.c)
  • Re: Statement functions
    ... It would be a simple way to avoid ambiguity with ... array assignment, especially in the case of an internal subprogram. ... same name and you forget to give a local type declaration ... no deficiencies and the other way is to make it so complicated ...
    (comp.lang.fortran)