Hi,
What wouldn't I give for a Int2Str fortran function!
In thread214-1521223 mikrom shows how to make a function which returns a variable length character. The problem is that I do not know the length of the return string until a have 'written' it into a string and trimmed it - and I can do that until after the declarations.. any solutions?
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
What wouldn't I give for a Int2Str fortran function!
In thread214-1521223 mikrom shows how to make a function which returns a variable length character. The problem is that I do not know the length of the return string until a have 'written' it into a string and trimmed it - and I can do that until after the declarations.. any solutions?
Code:
function int2Str(i)
character(len=????) :: int2Str
integer, intent(in) :: i
character(20) :: c
write (c,'(i20)') i
int2Str = trim(adjustl(c))
end function int2Str
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'