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
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
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
Copy file name to clipboardExpand all lines: docs/dictionary/keyword/semi-colon.lcdoc
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Type: keyword
4
4
5
5
Syntax: ;
6
6
7
-
Summary: The <character> <;> is used to place two <statement|statements> on a single <line>.
7
+
Summary: The <character> <;> is used to place more than one <statement> on a single <line>.
8
8
9
9
Introduced: 1.0
10
10
@@ -16,15 +16,20 @@ Example:
16
16
go next card; wait 1 second; go previous card
17
17
18
18
Example:
19
-
repeat with x = 1 to 10; doSomething x; end repeat
19
+
local x
20
+
repeat with x = 1 to 10; put x after field 1; end repeat
20
21
21
22
Description:
22
-
Use the ; character to compress code into fewer visible lines for easier reading.
23
+
Use the ; character to compress code into fewer visible <line|lines> for easier reading.
23
24
24
-
Lines that are split with <;> are shown in the <script editor> as a single <line>, but when <execute|executed>, are treated as multiple <lines> of code. The following line counts as three <statement|statements>:
25
+
Lines that are split with <;> are shown in the <script editor> as a single <line>,
26
+
but when <execute|executed>, are treated as multiple <line|lines> of code. The
27
+
following line counts as three <statement|statements>:
25
28
26
-
go card 1; beep 2; answer the date
29
+
go card 1; beep 2; answer the date
27
30
28
-
A <;> character which is used within a <literal string> does not signal a new line, because the <;> is treated as part of the <string> instead of being treated as a line break.
31
+
A <;> character which is used within a <literal string> does not signal a new <line>,
32
+
because the <;> is treated as part of the <string> instead of being treated as a line break.
answer whichPrompt /* use the prompt that was set earlier */
19
21
20
22
Example:
21
23
/* This entire block, although it is two lines
22
24
long, is a single comment. */
23
25
24
-
Description:
25
-
Anything between /* and */ is treated as a <comment> and is ignored by LiveCode when <execute|executing> the <handler>.
26
-
27
-
Comments are useful for documenting and explaining your code, either for others who might need to read and modify it, or for yourself. (The code may be clear in your mind now, but in six months, you'll be glad you included comments.)
28
-
29
-
The block comments created by </**/> differ from the line <comment|comments> created by -- because a <block comment> can span multiple <lines>, as well as a single <line> or part of a <line>. (A <comment> marked by <--> extends only to the end of the <line>.) A <comment> that starts with /* does not end until */, even if there are several lines in between.
30
-
31
-
Comments can be placed anywhere in a script--inside handlers or outside all handlers. In a long script with many handlers, it may be useful to divide the handlers into sections. Each section starts with a comment containing the section name and any other useful information. This practice helps you keep long scripts organized. Similarly, a lengthy handler can be made more readable by explanatory comments.
32
-
33
-
Comments can contain any text, including lines of LiveCode. If the code is within a comment, it's ignored. You can temporarily remove sections of code for debugging by putting those sections inside a comment.
0 commit comments