You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dictionary/command/add.lcdoc
+43-11Lines changed: 43 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -18,28 +18,60 @@ Example:
18
18
add 7 to field 1
19
19
20
20
Example:
21
+
local tSummaryOfInventory
21
22
add field "New" to tSummaryOfInventory
22
23
23
24
Example:
25
+
local qty, price, tOrder
24
26
add (qty * price) to last line of tOrder
25
27
28
+
Example:
29
+
# Assume the following handler in a button, along with
30
+
# field "list1" and field "list2" each containing
31
+
# an equal number of return-separated numerals.
32
+
# Field "added" is empty.
33
+
on mouseUp
34
+
local tNumList1, tNumList2
35
+
put fld "list1" into tNumList1
36
+
put fld "list2" into tNumList2
37
+
split tNumList1 by return
38
+
split tNumList2 by return
39
+
add tNumList2 to tNumList1
40
+
combine tNumList1 by row
41
+
put tNumList1 into fld "added"
42
+
end mouseUp
43
+
26
44
Parameters:
27
45
number: An expression that evaluates to a number.
28
46
chunk: A chunk expression specifying a portion of the container.
29
47
container: A field, button, or variable, or the message box.
30
-
array (array):
48
+
array (array): An array variable each of whose elements is a number.
31
49
arrayContainer (array): An array variable each of whose elements is a number.
32
50
33
51
Description:
34
-
Use the <add> <command> to add a number to a <container> or a portion of a <container>, or to add two <array|arrays> containing numbers.
35
-
36
-
The contents of the <container> (or the <chunk> of the <container>) must be a number or an <expression> that <evaluate|evaluates> to a number.
37
-
38
-
If a <number> is added to an <arrayContainer>, the <number> is added to each <element(keyword)>. If an <array> is added to an <arrayContainer>, both <array|arrays> must have the same number of <element(glossary)|elements> and the same dimension, and each <element(keyword)> in the <array> is added to the corresponding <element(keyword)> of the <arrayContainer>.
39
-
40
-
If the <container> or an <element(keyword)> of the <arrayContainer> is empty, the <add> <command> treats its contents as zero.
41
-
If <container> is a <field> or <button>, the <format> of the sum is determined by the <numberFormat> <property>.
42
-
43
-
References: field (keyword), element (keyword), button (keyword), numberFormat (property), union (command), multiply (command), sum (function), value (function), format (function), property (glossary), element (glossary), container (glossary), expression (glossary), array (glossary), evaluate (glossary), command (glossary)
52
+
Use the <add> <command> to add a number to a <container> or a portion of
53
+
a <container>, or to add two <array|arrays> containing numbers.
54
+
55
+
The contents of the <container> (or the <chunk> of the <container>) must
56
+
be a number or an <expression> that <evaluate|evaluates> to a number.
57
+
58
+
If a <number> is added to an <arrayContainer>, the <number> is added to
59
+
each <element(glossary)>. If an <array> is added to an <arrayContainer>,
60
+
both <array|arrays> must have the same number of
61
+
<element(glossary)|elements> and the same dimension, and each
62
+
<element(glossary)> in the <array> is added to the corresponding
63
+
<element(glossary)> of the <arrayContainer>.
64
+
65
+
If the <container> or an <element(glossary)> of the <arrayContainer> is
66
+
empty, the <add> <command> treats its contents as zero.
67
+
If <container> is a <field> or <button>, the <format> of the sum is
0 commit comments