Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 4cedc58

Browse files
committed
Merge branch 'develop-8.0' into develop
Conflicts: docs/dictionary/control_st/repeat.lcdoc -- deletion of outdated and non-recommended variable-creating example.
2 parents 17c3e19 + 09387c1 commit 4cedc58

File tree

17 files changed

+384
-193
lines changed

17 files changed

+384
-193
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
*.sh text eol=lf
3030
*.inc text eol=lf
3131

32+
# These files are processed by cygwin+bash so make sure they don't end with CRLF
33+
prebuilt/versions/* text eol=lf
34+
3235
# Denote all files that are truly binary and should not be modified.
3336
*.png binary
3437
*.jpg binary

builder/builder_utilities.livecodescript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
script "BuilderUtilities"
2-
constant kMergExtVersion = "2016-6-9"
2+
constant kMergExtVersion = "2016-6-24"
33

44
local sEngineDir
55
local sWorkDir

docs/dictionary/command/add.lcdoc

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,60 @@ Example:
1818
add 7 to field 1
1919

2020
Example:
21+
local tSummaryOfInventory
2122
add field "New" to tSummaryOfInventory
2223

2324
Example:
25+
local qty, price, tOrder
2426
add (qty * price) to last line of tOrder
2527

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+
2644
Parameters:
2745
number: An expression that evaluates to a number.
2846
chunk: A chunk expression specifying a portion of the container.
2947
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.
3149
arrayContainer (array): An array variable each of whose elements is a number.
3250

3351
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
68+
determined by the <numberFormat> <property>.
69+
70+
References: array (glossary), button (object), combine (command),
71+
command (glossary), container (glossary), element (glossary),
72+
element (keyword), evaluate (glossary), expression (glossary),
73+
field (object), format (glossary), multiply (command),
74+
numberFormat (property), property (glossary), split (command),
75+
sum (function), union (command), value (function)
4476

4577
Tags: math

docs/dictionary/command/filter.lcdoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,17 @@ characters to match, which may be combined with any number of the following spec
6363
- [char-char] : Matches any character whose unicode codepoint is between the first character and the second character.
6464
- [!chars] : Matches any character which is not one of the characters inside the brackets.
6565

66+
You can match instances of special chars as follows:
67+
68+
- `?` with `[?]`
69+
- `*` with `[*]`
70+
- `[` with `[[]`
71+
- `-` with `-`
72+
- `!` with `!`
73+
74+
For example, the wildcard <filterPattern> `[[]A]*` will match any string
75+
beginning with `[A]`.
76+
6677
The three bracketed forms can be combined to create more complex character classes, for
6778
example the pattern [!abcA-C] matches any character which is not a, b or c (upper or lower case)
6879

docs/dictionary/control_st/repeat.lcdoc

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,6 @@ repeat tCount times
4141
put "X" after field "counting"
4242
end repeat
4343

44-
Example:
45-
-- To create a numbered set of variables with similar names
46-
-- eg myVar1, myVar2, ... myVar20, you can use a repeat loop
47-
-- together with concatenation in the following form. Note that
48-
-- this structure will only work with variable checking
49-
-- turned off.
50-
-- If you prefer to declare your variables then an array is the
51-
-- recommended way of doing this.
52-
local tPrefix = "myVar"
53-
local tVarCount = 20
54-
repeat with tVarNum = 1 to 20
55-
put tPrefix & x into tVarName
56-
do "put empty into " & tVarName
57-
end repeat
58-
5944
Parameters:
6045
loopForm:
6146
The <loopForm> is one of the following forms:
@@ -76,7 +61,7 @@ counter or labelVariable: A legal <variable> name.
7661
chunkType: One of these text chunk types: byte, codeunit, codepoint, character (or char),
7762
token, trueword, word (or segment), item, sentence, paragraph or line.
7863
container: Any existing <container>; e.g. a <variable> or a <field>.
79-
array (array): Any existing <container> that contains an <array> of <value|values>.
64+
array (array): Any existing container, usually a variable, that contains an <array> of values.
8065

8166
Description:
8267
Use the <repeat> <control structure> to perform the same series of
@@ -121,13 +106,15 @@ Use the `until `*`condition`* or `while `*`condition`* form if you want
121106
to test a <conditional|condition> at the top of the loop, before the
122107
statements are executed. This example scrolls through the cards until
123108
the user clicks the mouse:
109+
124110
repeat until the mouseClick
125111
go next card
126112
wait for 100 milliseconds
127113
end repeat
128114

129115
This example repeats as long as the total number of characters in a
130116
field is less than the given amount:
117+
131118
local tCount
132119
put empty into field "myField"
133120
put 20 into tCount
@@ -173,8 +160,8 @@ you're using the `down to` form), the loop performs its final
173160
<iteration> and then ends.
174161

175162
If you specify an *increment*, the *increment* is added to the *counter*
176-
each time through the loop, rather than the *counter* being increased by
177-
1. (The *increment* is not treated as an absolute value: if you're using
163+
each time through the loop, rather than the *counter* being increased by 1.
164+
(The *increment* is not treated as an absolute value: if you're using
178165
the `down to` form, the *increment* must be negative.)
179166

180167
As with the `for `*`number`*` times` form described above, the
@@ -225,7 +212,7 @@ example changes a return-<delimit|delimited> list to a
225212
comma-<delimit|delimited> list:
226213

227214
repeat for each line thisLine in myList
228-
put thisLine comma after newList
215+
put thisLine & comma after newList
229216
end repeat
230217
delete the last char of newList
231218

@@ -239,8 +226,8 @@ each <element(glossary)> in an <array>. The following example gets only
239226
the multi-word entries in an <array> of phrases:
240227

241228
repeat for each element thisIndexTerm in listOfTerms
242-
if the number of words in thisIndexTerm 1 then
243-
put thisIndexTerm return after multiWordTerms
229+
if the number of words in thisIndexTerm > 1 then
230+
put thisIndexTerm & return after multiWordTerms
244231
end if
245232
end repeat
246233

@@ -254,17 +241,16 @@ will not affect what is being <iterate|iterated> over.
254241
command and appears in the commandNames.
255242

256243
Changes:
257-
The ability to specify an increment for the `repeat with `*`counter`*` =
258-
`*`startValue`*` to `*`endValue`* form was added in version 2.0. In
259-
previous versions, this form of the repeat control structure is always
260-
incremented or decremented the counter by 1 each time through the loop.
244+
The ability to specify an increment for the repeat with form was added in version 2.0.
245+
In previous versions, this form of the repeat control structure is always
246+
incremented or decremented the counter by 1 each time through the loop.
261247

262248
The ability to iterate through the keys of an array using repeat for
263-
each key was added in version 2.7.2
249+
each key was added in version 2.7.2.
264250

265-
Starting in version 7.0 it is possible to modify the *<container>*
266-
variable inside a `for each` loop without affecting the
267-
<iterate|iterations> of the loop.
251+
Starting in version 7.0 it is possible to modify the container
252+
variable inside a for each loop without affecting the
253+
iterations of the loop.
268254

269255
References: iteration (glossary), array (glossary), card (keyword),
270256
chunk (glossary), conditional (glossary), container (glossary),

docs/dictionary/keyword/any.lcdoc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Type: keyword
44

55
Syntax: any
66

7-
Summary: Designates a <random|randomly> chosen member of a set.
7+
Summary: Designates a <random(glossary)|randomly> chosen member of a set.
88

99
Introduced: 1.0
1010

@@ -13,6 +13,7 @@ OS: mac,windows,linux,ios,android
1313
Platforms: desktop,server,web,mobile
1414

1515
Example:
16+
local wordOfTheDay
1617
put any word of field "Dictionary" into wordOfTheDay
1718

1819
Example:
@@ -22,12 +23,16 @@ Example:
2223
select any button
2324

2425
Description:
25-
Use the <any> <keyword> to specify a <random> <object(glossary)> of a specified type, or to designate a <random> <chunk> in a <chunk expression>.
26+
Use the <any> <keyword> to specify a <random(glossary)> <object(glossary)> of a specified type, or to designate a
27+
<random(glossary)> <chunk> in a <chunk expression>.
2628

27-
The <any> <keyword> does not examine every member of a set; it specifies just one member of the set, randomly chosen. For example, the expression
28-
if myString is in any field
29-
checks whether myString is in a randomly chosen field, not whether myString is somewhere in one of the fields on the card.
29+
The <any> <keyword> does not examine every member of a set; it specifies just one member of the set, randomly chosen.
30+
For example, the expression
3031

31-
References: first (keyword), random (function), keyword (glossary), random (glossary), chunk expression (glossary), chunk (glossary), object (glossary)
32+
if myString is in any field
33+
checks whether `myString` is in a randomly chosen field, not whether `myString` is somewhere in one of the fields on the card.
34+
35+
References: first (keyword), last (keyword), random (function), keyword (glossary), random (glossary), chunk expression (glossary),
36+
chunk (glossary), object (glossary)
3237

3338
Tags: database

docs/dictionary/keyword/semi-colon.lcdoc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Type: keyword
44

55
Syntax: ;
66

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>.
88

99
Introduced: 1.0
1010

@@ -16,15 +16,20 @@ Example:
1616
go next card; wait 1 second; go previous card
1717

1818
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
2021

2122
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.
2324

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>:
2528

26-
go card 1; beep 2; answer the date
29+
go card 1; beep 2; answer the date
2730

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.
2933

30-
References: character (keyword), \ (keyword), line (keyword), string (keyword), lines (keyword), literal string (glossary), statement (glossary), script editor (glossary), execute (glossary)
34+
References: character (keyword), \ (keyword), line (glossary), string (glossary),
35+
literal string (glossary), statement (glossary), script editor (glossary), execute (glossary)

docs/dictionary/keyword/slashstarstarslash.lcdoc

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,44 @@ OS: mac,windows,linux,ios,android
1515
Platforms: desktop,server,web,mobile
1616

1717
Example:
18+
local whichPrompt
19+
put "Prompt text here." into whichPrompt
1820
answer whichPrompt /* use the prompt that was set earlier */
1921

2022
Example:
2123
/* This entire block, although it is two lines
2224
long, is a single comment. */
2325

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.
34-
35-
References: lines (keyword), -- (keyword), line (keyword), handler (glossary), comment (glossary), delimit (glossary), block comment (glossary), execute (glossary)
26+
Description: Anything between /&ast; and &ast;/ is treated as a
27+
<comment> and is ignored by LiveCode when <execute|executing> the
28+
<handler>.
29+
30+
<comment|Comments> are useful for documenting and explaining your code,
31+
either for others who might need to read and modify it, or for yourself.
32+
(The code may be clear in your mind now, but in six months, you'll be
33+
glad you included <comment|comments>.)
34+
35+
The <block comment|block comments> created by </&ast;&ast;/> differ from
36+
the line <comment|comments> created by <--> because a <block comment> can
37+
span multiple <line(glossary)|lines>, as well as a single
38+
<line(glossary)> or part of a <line(glossary)>. (A <comment> marked by
39+
<--> extends only to the end of the <line(glossary)>.) A <comment> that
40+
starts with /&ast; does not end until &ast;/, even if there are several
41+
<line(glossary)|lines> in between.
42+
43+
<comment|Comments> can be placed anywhere in a <script>--inside
44+
<handler|handlers> or outside all <handler|handlers>. In a long <script>
45+
with many <handler|handlers>, it may be useful to divide the
46+
<handler|handlers> into sections. Each section can start with a
47+
<comment> containing the section name and any other useful information.
48+
This practice helps you keep long <script|scripts> organized. Similarly,
49+
a lengthy handler can be made more readable by explanatory comments.
50+
51+
<comment|Comments> can contain any text, including <line(glossary)lines>
52+
of LiveCode scripting. If the code is within a <comment>, it's ignored.
53+
You can temporarily remove sections of code for debugging by putting
54+
those sections inside a <comment>.
55+
56+
References: -- (keyword), line (keyword), line (glossary),
57+
handler (glossary), comment (glossary), delimit (glossary),
58+
block comment (glossary), execute (glossary), script (glossary)

0 commit comments

Comments
 (0)