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 226
Expand file tree
/
Copy pathadd.lcdoc
More file actions
95 lines (69 loc) · 2.69 KB
/
add.lcdoc
File metadata and controls
95 lines (69 loc) · 2.69 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Name: add
Type: command
Syntax: add <number> to [<chunk> of] <container>
Syntax: add {<number> | <array>} to <arrayContainer>
Summary:
Adds a number to a <container> and places the resulting <value> in the
<container>.
Introduced: 1.0
OS: mac, windows, linux, ios, android
Platforms: desktop, server
Example:
add 7 to field 1
Example:
local tSummaryOfInventory
add field "New" to tSummaryOfInventory
Example:
local qty, price, tOrder
add (qty * price) to last line of tOrder
Example:
# Assume the following handler in a button, along with
# field "list1" and field "list2" each containing
# an equal number of return-separated numerals.
# Field "added" is empty.
on mouseUp
local tNumList1, tNumList2
put fld "list1" into tNumList1
put fld "list2" into tNumList2
split tNumList1 by return
split tNumList2 by return
add tNumList2 to tNumList1
combine tNumList1 by row
put tNumList1 into fld "added"
end mouseUp
Parameters:
number:
An expression that evaluates to a number.
chunk:
A chunk expression specifying a portion of the container.
container:
A field, button, or variable, or the message box.
array (array):
An array variable each of whose elements is a number.
arrayContainer (array):
An array variable each of whose elements is a number.
Description:
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.
The contents of the <container> (or the <chunk> of the <container>) must
be a number or an <expression> that <evaluate|evaluates> to a number.
If a <number> is added to an <arrayContainer>, the <number> is added to
each <element(glossary)>. 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(glossary)> in the <array> is added to the corresponding
<element(glossary)> of the <arrayContainer>.
If the <container> or an <element(glossary)> of the <arrayContainer> is
empty, the <add> <command> treats its contents as zero.
If <container> is a <field> or <button>, the <format> of the sum is
determined by the <numberFormat> <property>.
If a math operation on finite inputs produces a non-finite output, an
execution error is thrown. See <math operation|math operations> for more
information.
References: combine (command), multiply (command), split (command),
union (command), sum (function), value (function), array (glossary),
command (glossary), container (glossary), element (glossary),
evaluate (glossary), expression (glossary), format (glossary),
property (glossary), element (keyword), button (object), field (object),
numberFormat (property), math operation (glossary)
Tags: math