Separating external interface and body?

From: Andy (andy_at_ideafix.litec.csic.es)
Date: 10/27/03


Date: Mon, 27 Oct 2003 19:55:12 +0100

I am trying to separate the body of a module from its external
interface. I realize the code below does not compile but, hopefully, it
illustrates what I am trying to do:

module i_fred
   interface sub
      subroutine sub1( i )
        integer :: i
      end subroutine sub1
      subroutine sub2( r )
        real :: r
      end subroutine sub2
   end interface
end module i_fred

module b_fred
   use i_fred
   ! private declarations
contains
   subroutine sub1( i )
     integer :: i
     write (*,*) 'sub1: ',i
   end subroutine sub1
   subroutine sub2( r )
     real :: r
     write (*,*) 'sub2 ',r
   end subroutine sub2
end module b_fred

program testing
   use i_fred
   call sub( 1 )
   call sub( 1.1 )
end program testing



Relevant Pages

  • Re: Separating external interface and body?
    ... > I am trying to separate the body of a module from its external ... INTERFACE sub ... end subroutine sub1 ...
    (comp.lang.fortran)
  • Pointer
    ... integer, pointer:: stuff ... end subroutine sub1 ... end interface ... Prev by Date: ...
    (comp.lang.fortran)
  • Re: Supporting both access and sql
    ... ' Some Interface ... Private Function ISQLConnect_ConnAs ADODB.Connection ... Public Sub Main ...
    (microsoft.public.vb.database)
  • Re: IWMReader::Open Causes Unhandled Win32 exception
    ... > SUB MainAS String) ... > PUBLIC INTERFACE IWMReader ... > dwOutputNum AS Integer) AS ... > PUBLIC INTERFACE IWMReaderCallback ...
    (microsoft.public.win32.programmer.mmedia)
  • Marshal Structure containing arrays to function in DLL
    ... Declare Function nifGetInterfaceList Lib "nifbstd" (ByVal session As Long, ... ByRef info As NifInterfaceInfo) As Long ... Private Sub OpenSess() ... ' Pass the max interface number to function "nifGetInterfaceList" ...
    (microsoft.public.dotnet.languages.vb)