Re: printing logical variables as "true" and "false"





Richard E Maine wrote:
<beliavsky@xxxxxxx> wrote:


I would like to print logical variables as "true" and "false" rather
than just "T" and "F", which is what Fortran WRITE statements do. I can
define functions that convert .true. and .false. to the strings "true"
and "false", but is there some edit descriptor I have overlooked?


Nope. I don't know of a language-provided shortcut for this. Your
function is a pretty simple one to write, but I don't know a way to
avoid it.

I think the function has already been written.
      print *, merge("true", "false", logical_thingo)

unless I've missed something.

*** Hendrickson

.


Quantcast