diff options
Diffstat (limited to 'doc/scan.n')
-rw-r--r-- | doc/scan.n | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -5,7 +5,7 @@ '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" +'\" .TH scan n 8.4 Tcl "Tcl Built-In Commands" .so man.macros .BS @@ -37,7 +37,7 @@ performed. If the next character in \fIformat\fR is a blank or tab then it matches any number of white space characters in \fIstring\fR (including zero). -Otherwise, if it is not a \fB%\fR character then it +Otherwise, if it is not a \fB%\fR character then it must match the next character of \fIstring\fR. When a \fB%\fR is encountered in \fIformat\fR, it indicates the start of a conversion specifier. @@ -52,7 +52,7 @@ The fields that are present must appear in the order given above. When \fBscan\fR finds a conversion specifier in \fIformat\fR, it first skips any white-space characters in \fIstring\fR (unless the conversion character is \fB[\fR or \fBc\fR). -Then it converts the next input characters according to the +Then it converts the next input characters according to the conversion specifier and stores the result in the variable given by the next argument to \fBscan\fR. .SS "OPTIONAL POSITIONAL SPECIFIER" @@ -95,7 +95,7 @@ truncated as required by the size modifier value. .TP \fBo\fR . -The input substring must be an octal integer. It is read in and the +The input substring must be an octal integer. It is read in and the integer value is stored in the variable, truncated as required by the size modifier value. .TP @@ -123,29 +123,27 @@ with conversion character \fBu\fR. .TP \fBi\fR . -The input substring must be an integer. The base (i.e. decimal, binary, -octal, or hexadecimal) is determined in the same fashion as described in -\fBexpr\fR. The integer value is stored in the variable, +The input substring must be an integer. The base (i.e. decimal, octal, or hexadecimal) is determined by the C convention (leading 0 for octal; prefix 0x for hexadecimal). The integer value is stored in the variable, truncated as required by the size modifier value. .TP \fBc\fR . -A single character is read in and its Unicode value is stored in +A single character is read in and its Unicode value is stored in the variable as an integer value. Initial white space is not skipped in this case, so the input substring may be a white-space character. .TP \fBs\fR . -The input substring consists of all the characters up to the next +The input substring consists of all the characters up to the next white-space character; the characters are copied to the variable. .TP \fBe\fR or \fBf\fR or \fBg\fR or \fBE\fR or \fBG\fR . -The input substring must be a floating-point number consisting +The input substring must be a floating-point number consisting of an optional sign, a string of decimal digits possibly -containing a decimal point, and an optional exponent consisting -of an \fBe\fR or \fBE\fR followed by an optional sign and a string of +containing a decimal point, and an optional exponent consisting +of an \fBe\fR or \fBE\fR followed by an optional sign and a string of decimal digits. It is read in and stored in the variable as a floating-point value. .TP @@ -166,8 +164,8 @@ it is treated as part of \fIchars\fR rather than indicating a range. . The input substring consists of one or more characters not in \fIchars\fR. The matching string is stored in the variable. -If the character immediately following the \fB^\fR is a \fB]\fR then it is -treated as part of the set rather than the closing bracket for +If the character immediately following the \fB^\fR is a \fB]\fR then it is +treated as part of the set rather than the closing bracket for the set. If \fIchars\fR contains a sequence of the form \fIa\fB\-\fIb\fR then any @@ -183,12 +181,12 @@ of characters scanned from the input string so far is stored in the variable. .PP The number of characters read from the input for a conversion is the largest number that makes sense for that particular conversion (e.g. -as many decimal digits as possible for \fB%d\fR, as +as many decimal digits as possible for \fB%d\fR, as many octal digits as possible for \fB%o\fR, and so on). The input substring for a given conversion terminates either when a -white-space character is encountered or when the maximum substring +white-space character is encountered or when the maximum substring width has been reached, whichever comes first. -If a \fB*\fR is present in the conversion specifier +If a \fB*\fR is present in the conversion specifier then no variable is assigned and the next scan argument is not consumed. .SH "DIFFERENCES FROM ANSI SSCANF" .PP |