Re: Converting string to Integer, Real, etc...



Jeremy wrote:
How can I convert a string to an integer and other types? What about the reverse? I do not see an intrinsic for it.

Jeremy
It's called an internal read or internal write. in effect, you
use a character variable as the "file name" and read or write
the I/O list. Any book on Fortran should cover it. You do
things like

read(character_variable, format) list of variables

to "convert a string to an integer".

You want to be a little careful with a "string". Technically,
Fortran doesn't have them. It has character variables and they
are a little different from C strings. In particular, they have a
fixed length and don't have any special termination character.
Blank fill happens automagically in places where you might not
expect it.

*** Hendrickson
.