This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: practical use of iargc() getarg()


RadSurfer wrote:
Since getarg() returns strings, I was just wondering precisely how one
converts a string to the proper numerical type desired?

Strangely, the manual (gfortran.pdf) really does not show any practical
example for using getarg() as regards converting to numerical types.

I = IChar('123') ! Integer (How are the other types handled?)

no matter how often I read through that manual, I see nothing about
obtaining a REAL (single,double, let alone their attributes)
from a String!  Did I miss something?

You did. There's a "Note" in the documentation on the ICHAR intrinsic which explains (with an example) how to do an internal read in order to obtain a numerical value from a string.


Where exactly did you look? Perhaps there's someplace else that this information ought to go.

It's probably also important to note that the GFortran manual is _not_ a complete reference on the Fortran language, and should be supplemented with a proper language reference. There are many "how do I do this in Fortran?" questions that the GFortran manual doesn't contain the answers to.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]