I'm trying to simplify the output of text of console programs. Currently the programs are run in two different ways:
- Directly from CMD or batch script
- Remotely or blindly, called by another program
Thus, all information output to the user needs to go to both the console and to a default error file.
Currently, I'm just repeating myself:
write(*,*) "That wasn't a number!"
write(199,*) "That wasn't a number!"
The best I've come up with is using a subroutine:
subroutine werr(string)
implicit none
character*(*), intent(in) :: string
write(*,*) string
write(199,*) string
return
end subroutine
Better, but still requires call werr("Some text or another.")
Is there any way to emulate the way write works, whereby I can simply have werr("Some text or another.")
?