This repository was archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy patheach.lcdoc
More file actions
54 lines (39 loc) · 1.87 KB
/
each.lcdoc
File metadata and controls
54 lines (39 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
Name: each
Type: keyword
Syntax: each
Summary:
Used with the <sort container> <command> to specify that the <sort key>
consists of the specified <chunk> of each <line> or <item>. Also used
with the <for> <keyword> in a <repeat> <control structure> to specify
that the <loop|repeat loop> should be executed for each <chunk> of the
specified <string> or each <element> of the specified <array>.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Example:
sort lines of field "Address" by word 2 of each
Example:
repeat for each character thisChar in field "Input"
Description:
Use the <each> <keyword> to <sort> a <container> by a portion of each
<item> or <line>, rather than by the whole <item> or <line>, or to
<iteration|iterate> over each <chunk> in a <string> or each <element> in
an <array>.
In a <sort container> <command>, the expression before "of each" must be
a chunk expression. The <chunk expression> describes a portion of each
<item> or <line> in the <container> to be <sort|sorted>.
If a chunk is nonexistent for a particular line or item--for example, if
"by char 5 of each" is specified and some lines only have four
characters--the chunk is treated as though it were empty.
Changes:
The ability to specify each element of an array in a repeat control
structure was introduced in version 1.1. In previous versions, you could
use the each keyword to iterate over all chunks in a string, but not
over all elements in an array.
References: sort (command), sort container (command),
repeat (control structure), sort (glossary), loop (glossary),
chunk expression (glossary), iteration (glossary), container (glossary),
chunk (glossary), keyword (glossary), control structure (glossary),
array (glossary), command (glossary), sort key (glossary), item (keyword),
element (keyword), for (keyword), line (keyword), string (keyword)
Tags: text processing