See "Fortran 95/2003 Explained", p 301.
! .. Use Statements ..
USE def, ONLY : OPERATOR (.eqmodten.)
works.
Ewan Webster
>>> [log in to unmask] 16/01/06 08:29:22 >>>
All the compilers I tried choke on this one, so I guess
I am doing something wrong...
If I have
use def
in the following piece of code, it works.
But if I want to use only some entities of the module, how do I
specify my operator?
Thanks
Bertrand
----------------------------------------
module def
integer :: ia, ib, ic
interface operator ( .EQMODTEN. )
module procedure EQ_MOD_10
end interface
contains
logical function EQ_MOD_10( n1, n2)
implicit none
integer, intent( in) :: n1, n2
integer :: m1, m2
m1 = MOD( n1, 10)
m2 = MOD( n2, 10)
EQ_MOD_10 = .false.
if ( m1 == m2 ) EQ_MOD_10 = .true.
end function EQ_MOD_10
end module def
program test
! use def ! OK
use def, only : ib, .EQMODTEN. ! wrong
implicit none
integer :: na, nb
na = 17
nb = 43
if ( na .EQMODTEN. nb ) then
print *, ' yes '
else
print *, ' no '
endif
end program test
-------------------------------------
--
Bertrand Meltz
Commissariat a l Energie Atomique | e-mail : [log in to unmask]
CEA / DIF , BP 12 | Tel : (33) [0] 1 69 26 57 83
91680 Bruyeres-le-Chatel , FRANCE | Fax : (33) [0] 1 69 26 70 93
*****Disclaimer************
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only. If
you are not a named addressee, you must not use, retain or disclose
such information.
Serco cannot guarantee that the e-mail or any attachments are free
from viruses.
The views expressed in this e-mail are those of the originator and do
not necessarily represent the views of Serco.
Nothing in this e-mail shall bind Serco in any contract or obligation.
Serco Group plc. Registered in England and Wales. No: 2048608
Registered Office: Serco House, 16 Bartley Wood Business Park,
Bartley Way, Hook, Hampshire, RG27 9UY, United Kingdom.
*****End Disclaimer********
|