summaryrefslogtreecommitdiff
path: root/stdlib/scanf.mli
diff options
context:
space:
mode:
authorPierre Weis <Pierre.Weis@inria.fr>2007-10-09 10:11:52 +0000
committerPierre Weis <Pierre.Weis@inria.fr>2007-10-09 10:11:52 +0000
commit00f4865bad9838add05d832a05b19fb68da47043 (patch)
tree2fb585e3f18b75f7794d106057934f361bb6a6c7 /stdlib/scanf.mli
parent4167841b165fb2104ccd54664756d2d5dd69f643 (diff)
downloadocaml-00f4865bad9838add05d832a05b19fb68da47043.tar.gz
Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8417 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/scanf.mli')
-rw-r--r--stdlib/scanf.mli8
1 files changed, 5 insertions, 3 deletions
diff --git a/stdlib/scanf.mli b/stdlib/scanf.mli
index 0d558da7c8..37b1da1ddc 100644
--- a/stdlib/scanf.mli
+++ b/stdlib/scanf.mli
@@ -230,16 +230,18 @@ val bscanf : Scanning.scanbuf -> ('a, 'b, 'c, 'd) scanner;;
input function [ri] must therefore have type [Scanning.scanbuf -> 'a] and
the argument read has type ['a].
- [\{ fmt %\}]: reads a format string argument.
- The format string read must have the same type as [fmt].
+ The format string read must have the same type as the format string
+ specification [fmt].
For instance, ["%\{%i%\}"] reads any format string that can read a value of
type [int]; hence [Scanf.sscanf "fmt:\\\"number is %u\\\"" "fmt:%\{%i%\}"]
succeeds and returns the format string ["number is %u"].
- [\( fmt %\)]: scanning format substitution.
Reads a format string to replace [fmt].
- The format string read must have the same type as [fmt].
+ The format string read must have the same type as the format string
+ specification [fmt].
For instance, ["%\( %i% \)"] reads any format string that can read a value
of type [int]; hence [Scanf.sscanf "\\\"%4d\\\"1234.00" "%\(%i%\)"]
- succeeds and returns the format string ["number is %u"].
+ is equivalent to [Scanf.sscanf "1234.00" "%4d"].
- [l]: returns the number of lines read so far.
- [n]: returns the number of characters read so far.
- [N] or [L]: returns the number of tokens read so far.