summaryrefslogtreecommitdiffstats
path: root/doc/scan.n
diff options
context:
space:
mode:
authorhobbs <hobbs>1999-11-19 06:33:58 (GMT)
committerhobbs <hobbs>1999-11-19 06:33:58 (GMT)
commitb5a3b0736e5c9388b4979a05136aba4c833e902d (patch)
tree34190bd634f345f5fbdb9b251d0034f432ccc425 /doc/scan.n
parent4085140e65b5b9b7df45ab0cd8f6981240c32693 (diff)
downloadtcl-b5a3b0736e5c9388b4979a05136aba4c833e902d.zip
tcl-b5a3b0736e5c9388b4979a05136aba4c833e902d.tar.gz
tcl-b5a3b0736e5c9388b4979a05136aba4c833e902d.tar.bz2
* doc/scan.n:
* tests/scan.test: * generic/tclScan.c: finished support for inline scan by supporting XPG identifiers. * doc/http.n: * library/http2.1/http.tcl: added register and unregister commands to http:: package (better support for tls/SSL), as well as -type argument to http::geturl. [RFE: 2617] * doc/glob.n: added note about ..../ glob behavior on Win9* * doc/tcltest.n: fixed minor example errors [Bug: 3551]
Diffstat (limited to 'doc/scan.n')
-rw-r--r--doc/scan.n39
1 files changed, 25 insertions, 14 deletions
diff --git a/doc/scan.n b/doc/scan.n
index 123ec5b..b9ed0be 100644
--- a/doc/scan.n
+++ b/doc/scan.n
@@ -5,10 +5,10 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: scan.n,v 1.3 1999/04/16 00:46:36 stanton Exp $
+'\" RCS: @(#) $Id: scan.n,v 1.4 1999/11/19 06:33:59 hobbs Exp $
'\"
.so man.macros
-.TH scan n "" Tcl "Tcl Built-In Commands"
+.TH scan n 8.3 Tcl "Tcl Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -19,15 +19,21 @@ scan \- Parse string using conversion specifiers in the style of sscanf
.SH INTRODUCTION
.PP
-This command parses fields from an input string in the same fashion
-as the ANSI C \fBsscanf\fR procedure and returns a count of the number
-of conversions performed, or -1 if the end of the input string is
-reached before any conversions have been performed.
-\fIString\fR gives the input to be parsed and \fIformat\fR indicates
-how to parse it, using \fB%\fR conversion specifiers as in \fBsscanf\fR.
-Each \fIvarName\fR gives the name of a variable; when a field is
-scanned from \fIstring\fR the result is converted back into a string
-and assigned to the corresponding variable.
+This command parses fields from an input string in the same fashion as the
+ANSI C \fBsscanf\fR procedure and returns a count of the number of
+conversions performed, or -1 if the end of the input string is reached
+before any conversions have been performed. \fIString\fR gives the input
+to be parsed and \fIformat\fR indicates how to parse it, using \fB%\fR
+conversion specifiers as in \fBsscanf\fR. Each \fIvarName\fR gives the
+name of a variable; when a field is scanned from \fIstring\fR the result is
+converted back into a string and assigned to the corresponding variable.
+.VS 8.3
+If no \fIvarName\fR variables are specified, then \fBscan\fR works in an
+inline manner, returning the data that would otherwise be stored in the
+variables as a list. In the inline case, an empty string is returned when
+the end of the input string is reached before any conversions have been
+performed.
+.VE 8.3
.SH "DETAILS ON SCANNING"
.PP
@@ -63,7 +69,8 @@ by the number, where 1 corresponds to the first \fIvarName\fR. If
there are any positional specifiers in \fIformat\fR then all of the
specifiers must be positional. Every \fIvarName\fR on the argument
list must correspond to exactly one conversion specifier or an error
-is generated.
+is generated, or in the inline case, any position can be specified
+at most once and the empty positions will be filled in with empty strings.
.VE 8.1
.PP
The following conversion characters are supported:
@@ -163,8 +170,7 @@ The behavior of the \fBscan\fR command is the same as the behavior of
the ANSI C \fBsscanf\fR procedure except for the following differences:
.VS 8.1
.IP [1]
-\fB%p\fR conversion specifier is not currently
-supported.
+\fB%p\fR conversion specifier is not currently supported.
.VE 8.1
.IP [2]
For \fB%c\fR conversions a single character value is
@@ -177,6 +183,11 @@ values are always converted as if there were no modifier present
and real values are always converted as if the \fBl\fR modifier
were present (i.e. type \fBdouble\fR is used for the internal
representation).
+.VS 8.3
+.IP [4]
+If the end of the input string is reached before any conversions have been
+performed and no variables are given, and empty string is returned.
+.VE 8.3
.SH KEYWORDS
conversion specifier, parse, scan