The information in this article applies to:
SUMMARYMicrosoft FORTRAN PowerStation does not permit list-directed I/O for internal files. As a result, you may find it difficult to convert character strings to numeric values unless you know the exact format of the string. However, the atoi and atof functions included in the LIBC.LIB library can accomplish the translation. MORE INFORMATION
To use the atof and atoi functions, you must create interfaces to the
functions, and declare the types of the functions.
Use some caution and error checking when employing these functions. If
the atof or atoi function cannot convert the string format, it returns zero
(0.0 or 0) as the error condition. You should consult the C run-time
library reference for complete information on these functions.
FORTRAN does not null terminate strings, so the functions may incorrectly translate a string that contains digits up to the end. To be safe, insert a null character in the last position of the string. For example, the following command null terminates the string "a":
Sample CodeCompiler options needed: none
Additional query words: kbinf 1.00 1.00a 4.00 VAX porting port
Keywords : kbcode kbFortranPS kbLangFortran |
Last Reviewed: November 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |