Re: procedure argument



Roland Schmehl wrote:
a question regarding the usage of procedure arguments with different
argument lists.

the appended code compiles and writes out:

sub1: a= 1.0
sub2: a= 1.0 , b= 2.0

when i replace the two "EXTERNAL sub" statements by interface blocks

INTERFACE
SUBROUTINE sub (a,b)
REAL :: a,b
END SUBROUTINE sub
END INTERFACE

the compiler complains (as it should) about the different number of arguments of actual and dummy procedure.

why does it accept the EXTERNAL statements?

thanks,
roland
....snip

Before F90, no procedure prototypes existed, but you could still pass an external procedure as an argument. EXTERNAL comes from pre-F90. The current method of procedure "pointer" passing is still somewhat incomplete. In F2003, you will be able to explicitly declare a procedure pointer and it's argument prototype.

Joe
.



Relevant Pages

  • Re: Could this result in Array Distortion ??
    ... | subroutine sub ... The above is exactly how I said NOT to use adjustable dimensions. ... subroutine sub ...
    (comp.lang.fortran)
  • Re: Assumed shape array help
    ... >> call sub ) ... >> subroutine sub ... >> by use of a nasty explicit interface/module, the compiler still checks ... > dimensional arrays. ...
    (comp.lang.fortran)
  • More experimentation with C-style optional arguments
    ... not present if the pointer to it was NULL. ... "a zero" needs testing. ... end subroutine sub ... write') 'In sub, x = NULL' ...
    (comp.lang.fortran)
  • about the order of program units
    ... I can't find any limits on the order of program units on chapter 2 and ... while this program fails to compile by gfortran and CVF: ... end subroutine sub ... !end subroutine sub ...
    (comp.lang.fortran)
  • RE: Code no longer working
    ... That code compiles so that is not our issue. ... Sub Charge() ... Dim lngLastRow As Long ... I get the error message "Compile error: ...
    (microsoft.public.excel.programming)