Anything wrong with this code ?
module mod1
character*256 CurrentDirectoryName, CURDIR@
contains
integer function aa()
CurrentDirectoryName = CURDIR@()
aa = 2
end function
end module
!-------------------------------------------
program A
use mod1
i = aa ()
print*, trim(CurrentDirectoryName)
end
while this one works OK:
character*256 CurrentDirectoryName, CURDIR@
CurrentDirectoryName = CURDIR@()
print*, trim(CurrentDirectoryName)
end
Very useful function but causing me headaches for decades.