Tcl Source Code

Check-in [694b8c4633]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:array for: updated documentation: value variable is not optional, add specifics about when array for terminates.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tip-421
Files: files | file ages | folders
SHA3-256: 694b8c463389dd2e6341f270bbf59cee54d1fee70e673b21790165b08bad4952
User & Date: bll 2018-03-06 18:21:34.714
Context
2018-03-06
18:42
array for: Add missing ObjCmdProc wrapper around the NR proc. check-in: 4a61f6e2be user: bll tags: tip-421
18:21
array for: updated documentation: value variable is not optional, add specifics about when array for... check-in: 694b8c4633 user: bll tags: tip-421
17:19
tip-421: array for: a) Fix bug starting search (name not set). b) Fix error message for array ch... check-in: 736d436f40 user: bll tags: tip-421
Changes
Unified Diff Ignore Whitespace Patch
Changes to doc/array.n.
43
44
45
46
47
48
49
50
51
52
53
54
55


56
57
58
59
60
61
62
been the return value from a previous invocation of
\fBarray startsearch\fR.  Returns an empty string.
.TP
\fBarray exists \fIarrayName\fR
Returns 1 if \fIarrayName\fR is an array variable, 0 if there
is no variable by that name or if it is a scalar variable.
.TP
\fBarray for {\fIkeyVariable ?valueVariable?\fB} \fIarrayName body\fR
The first argument is a one or two element list of variable names for the
key and value of each entry in the array.  The second argument is the
array name to iterate over.  The third argument is the body to execute
for each key and value returned.
The ordering of the returned keys is undefined.


.TP
\fBarray get \fIarrayName\fR ?\fIpattern\fR?
Returns a list containing pairs of elements.  The first
element in each pair is the name of an element in \fIarrayName\fR
and the second element of each pair is the value of the
array element.  The order of the pairs is undefined.
If \fIpattern\fR is not specified, then all of the elements of the







|
|




>
>







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
been the return value from a previous invocation of
\fBarray startsearch\fR.  Returns an empty string.
.TP
\fBarray exists \fIarrayName\fR
Returns 1 if \fIarrayName\fR is an array variable, 0 if there
is no variable by that name or if it is a scalar variable.
.TP
\fBarray for {\fIkeyVariable valueVariable\fB} \fIarrayName body\fP
The first argument is a two element list of variable names for the
key and value of each entry in the array.  The second argument is the
array name to iterate over.  The third argument is the body to execute
for each key and value returned.
The ordering of the returned keys is undefined.
If an array element is deleted or a new array element is inserted during
the \fIarray for\fP process, the command will terminate with an error.
.TP
\fBarray get \fIarrayName\fR ?\fIpattern\fR?
Returns a list containing pairs of elements.  The first
element in each pair is the name of an element in \fIarrayName\fR
and the second element of each pair is the value of the
array element.  The order of the pairs is undefined.
If \fIpattern\fR is not specified, then all of the elements of the