aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/intrinsic.texi
diff options
context:
space:
mode:
authorBrooks Moses <brooks.moses@codesourcery.com>2007-03-08 23:12:25 +0000
committerBrooks Moses <brooks@gcc.gnu.org>2007-03-08 15:12:25 -0800
commit122e35b490d32ba0a2d6ea1cef03366c137f3431 (patch)
treed2e68cb4ea651de0a7f17c6fe66ffe687114e3a3 /gcc/fortran/intrinsic.texi
parent435b0aa2dfe94ab7fc36d6da0f89445da00540f8 (diff)
downloadgcc-122e35b490d32ba0a2d6ea1cef03366c137f3431.zip
gcc-122e35b490d32ba0a2d6ea1cef03366c137f3431.tar.gz
gcc-122e35b490d32ba0a2d6ea1cef03366c137f3431.tar.bz2
intrinsic.texi: (ICHAR) Improve internal I/O note.
* intrinsic.texi: (ICHAR) Improve internal I/O note. (ACHAR): Reference it. (CHAR): Reference it. (IACHAR): Reference it. From-SVN: r122729
Diffstat (limited to 'gcc/fortran/intrinsic.texi')
-rw-r--r--gcc/fortran/intrinsic.texi32
1 files changed, 24 insertions, 8 deletions
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index e0c472b..5072456 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -478,6 +478,10 @@ program test_achar
end program test_achar
@end smallexample
+@item @emph{Note}:
+See @ref{ICHAR} for a discussion of converting between numerical values
+and formatted string representations.
+
@item @emph{See also}:
@ref{CHAR}, @ref{IACHAR}, @ref{ICHAR}
@@ -1856,6 +1860,10 @@ program test_char
end program test_char
@end smallexample
+@item @emph{Note}:
+See @ref{ICHAR} for a discussion of converting between numerical values
+and formatted string representations.
+
@item @emph{See also}:
@ref{ACHAR}, @ref{IACHAR}, @ref{ICHAR}
@@ -4606,6 +4614,10 @@ program test_iachar
end program test_iachar
@end smallexample
+@item @emph{Note}:
+See @ref{ICHAR} for a discussion of converting between numerical values
+and formatted string representations.
+
@item @emph{See also}:
@ref{ACHAR}, @ref{CHAR}, @ref{ICHAR}
@@ -4851,21 +4863,25 @@ end program test_ichar
@end smallexample
@item @emph{Note}:
-No intrinsic exists to convert a printable character string to a
-numerical value. For example, there is no intrinsic that, given the
-@code{CHARACTER} value @code{'154'}, returns an @code{INTEGER} or
-@code{REAL} value with the value 154.
-
-Instead, you can use internal-file I/O to do this kind of conversion. For
+No intrinsic exists to convert between a numeric value and a formatted
+character string representation -- for instance, given the
+@code{CHARACTER} value @code{'154'}, obtaining an @code{INTEGER} or
+@code{REAL} value with the value 154, or vice versa. Instead, this
+functionality is provided by internal-file I/O, as in the following
example:
@smallexample
program read_val
integer value
- character(len=10) string
-
+ character(len=10) string, string2
string = '154'
+
+ ! Convert a string to a numeric value
read (string,'(I10)') value
print *, value
+
+ ! Convert a value to a formatted string
+ write (string2,'(I10)') value
+ print *, string2
end program read_val
@end smallexample