[Info-vax] LIB$ equivalent of DCL f$type() ?

Bob Gezelter gezelter at rlgsc.com
Mon Dec 21 11:45:18 EST 2009


On Dec 21, 10:59 am, DTL <didier.mora... at gmail.com> wrote:
> Hello Folks,
>
> What is the RTL equivalent for the DCL f$type() lexical function
> please ?
> I need to know within a Fortran program if a given ascii field
> contains a number or not.
>
> Many thanks.
>
> Didier

Didier,

In short, there is no direct equivalent. In FORTRAN, bits are bits,
there is no propagation of type information into run time (e.g., you
can store character data in integers or reals in classic FORTRAN, all
that matters is how you use your format statements).

It is not difficult to read in the data as a character data, examine
it a character at a time, and decide how to use internal IO to
reprocess it using the appropriate format description. It is
admittedly not particularly elegant, but it does work.

- Bob Gezelter, http://www.rlgsc.com




More information about the Info-vax mailing list