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

Bob Koehler koehler at eisner.nospam.encompasserve.org
Mon Dec 21 15:19:01 EST 2009


In article <adb8e6cf-ec1d-4b26-a393-ee994c24cdd1 at k4g2000yqb.googlegroups.com>, DTL <didier.morandi at gmail.com> writes:
> 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.

   Depends on the language.  In Fortran, I'd do an internal read with a
   numeric conversion specifier and see if I get an error.  Other 
   languages have similar capability (but look out for being able to tell 
   "0" from non-numeric, some routines return 0 for both).  Or you can 
   just scan all the characters in the string to see if they're 0 - 9.

   Some language RTL's have routines specific to this need, bit
   I'm sure you could do a similar approach with the OTS$ conversion
   routines, if you wanted something VMS specific and language
   independent.




More information about the Info-vax mailing list