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

Commit af87884

Browse files
seaniepiepeter-b
authored andcommitted
[Docs] functions C-M - parameter and syntax fixes (#4818)
* functions parameter and syntax fixes to codepointProperty, compound, decompress, libUrlMultipartFormAddPart, localLoc, measureText and mobileBuildInfo * update - camelCase a parameter reference
1 parent 9228142 commit af87884

File tree

7 files changed

+74
-80
lines changed

7 files changed

+74
-80
lines changed

docs/dictionary/function/codepointProperty.lcdoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ Example:
2121
put codePointProperty(codepoint 1 of tString, "Name")
2222

2323
Parameters:
24-
unicodeCodepoint:
24+
unicodeCodepoint(string):
2525
A Unicode codepoint, or an expression which evaulates to a Unicode
26-
codepoint.
26+
codepoint.
2727

2828
propertyName (enum):
29-
The name of a supported UCD codepoint property Examples of supported
30-
properties, for a full list see
31-
http://www.unicode.org/versions/Unicode6.2.0/ch04.pdf
29+
The name of a supported UCD codepoint property. Examples of supported
30+
properties, for a full list see http://www.unicode.org/versions/Unicode6.2.0/ch04.pdf
3231

3332
- "Name": Unique name for the codepoint
3433
- "Numeric_Value": Numerical value, e.g. 4 for 4
@@ -37,7 +36,7 @@ http://www.unicode.org/versions/Unicode6.2.0/ch04.pdf
3736
- "Lowercase": True if the codepoint is lower-case
3837

3938

40-
Returns:
39+
Returns(string):
4140
The codepointProperty returns the value of the UCD property for the
4241
specified Unicode codepoint.
4342

@@ -55,12 +54,11 @@ There are many properties available; please see the version 6.3.0 of the
5554
Unicode standard, Chapter 4 and Section 5 of Unicode Technical Report
5655
(TR)#44 for details on the names and values of properties. Property
5756
names may be specified with either spaces or underscores and are not
58-
case-sensitive.
57+
case-sensitive.
5958

6059
>*Note:* This function is not intended for general-purpose use; please
61-
> use functions such as <toUpper> or the is operators instead.
60+
> use functions such as <toUpper> or the <is|equals> operators instead.
6261

6362
References: nativeCharToNum (function), numToNativeChar (function),
6463
toUpper (function), numToCodepoint (function), codepoint (keyword),
65-
codepoints (keyword)
66-
64+
codepoints (keyword), equals (operator)

docs/dictionary/function/compound.lcdoc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name: compound
22

33
Type: function
44

5-
Syntax: compound(<interestPerPeriod>, <numberOfPeriods>)
5+
Syntax: compound(<interestRate>, <numberOfPeriods>)
66

77
Summary:
88
<return|Returns> the principal plus accrued interest of an investment.
@@ -20,17 +20,16 @@ Example:
2020
put theInvestment * compound(yearlyInterest,numberYears) into endValue
2121

2222
Parameters:
23-
interestPerPeriod:
23+
interestRate(number):
24+
A positive number. The <interestRate> is expressed as a fraction of 1 so,
25+
for example, an 8% rate is written .08.
2426

2527

26-
numberOfPeriods:
28+
numberOfPeriods(integer):
2729
A positive number.
2830

29-
interestRate:
30-
A positive number. The interestRate is expressed as a fraction of 1 so,
31-
for example, an 8% rate is written .08.
3231

33-
Returns:
32+
Returns(number):
3433
The <compound> <function> <return|returns> a positive number.
3534

3635
Description:
@@ -45,11 +44,10 @@ The formula for the value of an compound-interest-bearing account is
4544
The <compound> <function> calculates this value.
4645

4746
The <numberOfPeriods> and the <interestRate> must use the same unit of
48-
time. For example, if the periods are months, the interest rate is the
47+
time. For example, if the periods are months, the <interestRate> is the
4948
interest per month.
5049

5150
References: function (control structure), annuity (function),
5251
round (function), return (glossary)
5352

5453
Tags: math
55-

docs/dictionary/function/decompress.lcdoc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ OS: mac, windows, linux, ios, android
1616
Platforms: desktop, server, mobile
1717

1818
Example:
19-
decompress(receivedString)
19+
decompress(tReceivedString)
2020

2121
Example:
2222
put decompress(it) into URL "file:data.txt"
@@ -26,12 +26,9 @@ go stack decompress(URL "binfile:newstuff.gz")
2626

2727
Parameters:
2828
gzippedString (string):
29-
30-
31-
data (string):
3229
A string of compressed binary data.
3330

34-
Returns:
31+
Returns(string):
3532
The <decompress> <function> <return|returns> a <string>.
3633

3734
Description:
@@ -56,4 +53,3 @@ return (glossary), function (glossary), string (keyword),
5653
inverse (keyword)
5754

5855
Tags: text processing
59-

docs/dictionary/function/libUrlMultipartFormAddPart.lcdoc

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name: libURLMultipartFormAddPart
22

33
Type: function
44

5-
Syntax: libURLMultipartFormAddPart(<form data>,<part name>, <value> [,<MIME type>, <encoding>])
5+
Syntax: libURLMultipartFormAddPart(<formData>,<partName>, <value> [,<MIMEtype>, <encoding>])
66

77
Summary:
88
This function lets you add parts to a multipart form one at a time. It
@@ -22,10 +22,11 @@ Security: network
2222

2323
Example:
2424
command UploadFileToServer pName, pMessage, pFilename
25+
local tOrigHeaders, tForm, tError, tFile, tType, tEnc, tURL
2526
put the httpHeaders into tOrigHeaders
2627
put empty into tForm
2728
put libURLMultipartFormData (tForm, "name", pName, "message", pMessage) into tError
28-
29+
2930
if tError is empty then
3031
set the httpHeaders to line 1 of tForm
3132
delete line 1 of tForm
@@ -34,14 +35,14 @@ command UploadFileToServer pName, pMessage, pFilename
3435
put "binary" into tEnc
3536
put libURLMultipartFormAddPart(tForm,"file", tFile, tType, tEnc) into tError
3637
end if
37-
38+
3839
if tError is empty then
3940
post tForm to url tURL
4041
put the result into tError
4142
end if
42-
43+
4344
set the httpHeaders to tOrigHeaders
44-
45+
4546
if tError is not empty then
4647
return tError for error
4748
else
@@ -50,24 +51,28 @@ command UploadFileToServer pName, pMessage, pFilename
5051
end UploadFileToServer
5152

5253
Parameters:
53-
value:
54+
formData(string): A variable, which will be filled with the form data.
5455

56+
partName(string): The name of the new part to add to the <formData>.
5557

56-
encoding:
58+
value(string): The value to be associated with the <partName> of the <formData>.
59+
60+
MIMEtype(enum): The MIME type to use for the <value>.
61+
62+
encoding(enum): The encoding type to use for the <value>.
5763

5864

5965
Description:
6066
This function is mainly used if you have called the
6167
<libURLMultipartFormData> with no arguments except the form data. This
6268
will return an "empty" form which can be added to using this function.
6369

64-
>*Important:* The <libURLMultipartFormAddPart> <function> is part of
65-
> the
66-
> <Internet library>. To ensure that the <function> works in a
67-
> <standalone application>, you must include this
68-
> <LiveCode custom library|custom library> when you create your
69-
> <standalone application|standalone>. In the Inclusions pane of the
70-
> <Standalone Application Settings> window, make sure the "Internet"
70+
>*Important:* The <libURLMultipartFormAddPart> <function> is part of the
71+
> <Internet library>. To ensure that the <function> works in a
72+
> <standalone application>, you must include this
73+
> <LiveCode custom library|custom library> when you create your
74+
> <standalone application|standalone>. In the Inclusions pane of the
75+
> <Standalone Application Settings> window, make sure the "Internet"
7176
> script library is selected.
7277

7378
References: post (command), libURLMultipartFormData (function),
@@ -78,4 +83,3 @@ group (glossary), standalone application (glossary), keyword (glossary),
7883
function (glossary), application (glossary), Internet library (library),
7984
library (library), startup (message), openBackground (message),
8085
preOpenStack (message), openStack (message), preOpenCard (message)
81-

docs/dictionary/function/localLoc.lcdoc

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Syntax: localLoc(<globalPoint>)
99
Summary:
1010
<return|Returns> the equivalent, in <relative coordinates|local
1111
coordinates>, of a <point> given in <absolute coordinates|global
12-
coordinates>.
12+
coordinates>.
1313

1414
Introduced: 1.0
1515

@@ -24,39 +24,35 @@ Example:
2424
localLoc(the location of field 1)
2525

2626
Parameters:
27-
globalPoint:
28-
29-
30-
point:
31-
Any expression that evaluates to a point--a vertical and horizontal
27+
globalPoint(point):
28+
Any expression that evaluates to a <point(glossary)>--a vertical and horizontal
3229
distance from the top left of the screen, separated by a comma.
3330

34-
Returns:
31+
Returns(point):
3532
The <localLoc> <function> <return|returns> two <integer|integers>
3633
separated by a comma.
3734

3835
Description:
3936
Use the <localLoc> <function> to translate between screen and <relative
4037
coordinates|window coordinates>.
4138

42-
In window coordinates, the point 0,0 is at the top left of the stack
43-
window. In screen coordinates, the point 0,0 is at the top left of the
44-
screen.
39+
In window coordinates, the <point(glossary)> 0,0 is at the top left of the stack
40+
window. In screen coordinates, the <point(glossary)> 0,0 is at the top left of
41+
the screen.
4542

46-
The point returned by the <localLoc> <function> is relative to the top
43+
The <point(glossary)> returned by the <localLoc> <function> is relative to the top
4744
left of the <current stack>.
4845

4946
The first item of the returned value is the horizontal distance in
5047
pixels from the left edge of the current stack to the location given by
51-
<point>. The second <item> of the <return value|returned value> is the
48+
<globalPoint>. The second <item> of the <return value|returned value> is the
5249
vertical distance from the top edge of the <current stack> to the
53-
location given by <point>.
50+
location given by <globalPoint>.
5451

5552
References: function (control structure), selectedLoc (function),
5653
relative coordinates (glossary), current stack (glossary),
5754
absolute coordinates (glossary), return (glossary),
5855
return value (glossary), integer (glossary), item (keyword),
59-
point (keyword), relative (keyword)
56+
point (keyword), point (glossary), relative (keyword)
6057

6158
Tags: ui
62-

docs/dictionary/function/measureText.lcdoc

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name: measureText
22

33
Type: function
44

5-
Syntax: measureText(<text>,<object reference>,[<mode>])
5+
Syntax: measureText(<text>,<objectReference>,[<mode>])
66

77
Summary:
88
<return|Returns> the width, size or bounds of the text drawn with the
@@ -15,25 +15,33 @@ OS: mac, windows, linux, ios, android
1515
Platforms: desktop, server, mobile
1616

1717
Example:
18-
put measureText(theText,me) into theTextWidth
18+
put measureText(tText,me) into tTextWidth
1919

2020
Example:
21-
put measureText(theText,me,"size") into theTextSize
21+
put measureText(tText,me,"size") into tTextSize
2222

2323
Example:
24-
put measureText(theText,me,"bounds") into theTextBounds
24+
put measureText(tText,me,"bounds") into tTextBounds
2525

2626
Parameters:
27-
text:
27+
text(string):
2828
Any native string. For unicode strings use measureUnicodeText.
2929

30-
mode:
31-
One of: width - (default if not specified) - returns the width of the
32-
text size - returns the width,height of the text bounds - returns a
33-
rectangle identifying the bounds of the text in the form
34-
0,-ascent,width,descent where ascent and descent are relative to a 0
35-
baseline the text is drawn on. object reference: An expression that
36-
evaluates to an object reference.
30+
objectReference(string):
31+
An expression that evaluates to an object reference.
32+
33+
mode(enum):
34+
- width: (default if not specified)
35+
- size:
36+
- bounds:
37+
38+
returns:
39+
- width(number): the width of the text
40+
- size(int,int): the width,height of the text
41+
- bounds(rect): a rectangle identifying the bounds of the text in the
42+
form `0,-ascent,width,descent` where ascent and descent are relative to
43+
a 0 baseline the text is drawn on.
44+
3745

3846
Description:
3947
Use the <measureText> <function> to find the dimensions of text drawn
@@ -43,4 +51,3 @@ References: function (control structure), measureUnicodeText (function),
4351
return (glossary), formattedWidth (property), formattedHeight (property)
4452

4553
Tags: ui
46-

docs/dictionary/function/mobileBuildInfo.lcdoc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name: mobileBuildInfo
22

33
Type: function
44

5-
Syntax: mobileBuildInfo(<propertyName>)
5+
Syntax: mobileBuildInfo(<propertyInfo>)
66

77
Summary:
88
Returns information about the current device.
@@ -20,16 +20,13 @@ Example:
2020
put mobileBuildInfo("SERIAL") into tDeviceSerialNumber
2121

2222
Parameters:
23-
propertyName:
24-
25-
2623
propertyInfo (enum):
2724
The name of the property to be retrieved.
2825

2926
- "BOARD": The name of the underlying board, like "goldfish"
3027
- "BOOTLOADER": The system bootloader version number.
3128
- "BRAND": The brand (e.g. carrier) the software is customized for, if
32-
any.
29+
any.
3330
- "CPU_ABI": The name of the instruction set (CPU type + ABI
3431
converntion) of native code.
3532
- "CPU_ABI2": The name of the second instruction set (CPU type + ABI
@@ -48,20 +45,18 @@ The name of the property to be retrieved.
4845
- "RADIO": The radio firmware version number.
4946
- "SERIAL": A hardware serial number, if available.
5047
- "TAGS": Comma-separated tags describing the build, like
51-
"unsigned,debug".
48+
"unsigned,debug".
5249
- "TIME": The time, in seconds since the start of the eon.
5350
- "TYPE": The type of build, like "user" or "eng".
5451
- "USER": The user name of the user who built the current version of
55-
Android.
52+
Android.
53+
54+
Returns(string):
55+
The requested information about the current device.
5656

5757

5858
Description:
5959
Use the <mobileBuildInfo> function to fetch information about the
6060
current device, such as the manufacturer and device name.
6161

62-
The <mobileBuildInfo> function returns information about the current
63-
device.
64-
6562
>*Note:* Property names are case sensitive.
66-
67-

0 commit comments

Comments
 (0)