Skip to content

Commit 067430e

Browse files
committed
Fixed several errors in MScript examples in the documentation.
1 parent d992529 commit 067430e

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

docs/data-types.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ <h4 id="string-lower"> <code><span class="keyword">string</span> lower()</code><
300300
<p>
301301
Returns a copy of this string, with all characters turned into lowercase characters.</p>
302302
<p>
303-
For example, <code>'This is GOOD'.upper()</code> returns <code>'this is good'</code>.</p>
303+
For example, <code>'This is GOOD'.lower()</code> returns <code>'this is good'</code>.</p>
304304
<hr>
305305
<h4 id="splitting-and-joining">Splitting and joining</h4>
306306
<h4 id="string-split"> <code><span class="keyword">array</span> split(<span class="keyword">any</span> delimiters = <span class="keyword">none</span>, <span class="keyword">number</span> count = <span class="keyword">none</span>)</code></h4>
@@ -319,7 +319,7 @@ <h4 id="string-join"> <code><span class="keyword">string</span> join(<span class
319319
<p>
320320
Combines the string representation of the values in the given array, while inserting this string in-between each pair of values.</p>
321321
<p>
322-
For example, <code>';'.join('apple', 'pear', 'banana')</code> returns <code>'apple;pear;banana'</code>.</p>
322+
For example, <code>';'.join(['apple', 'pear', 'banana'])</code> returns <code>'apple;pear;banana'</code>.</p>
323323
<hr>
324324
<h4 id="regular-expressions">Regular expressions</h4>
325325
<h4 id="string-match"> <code><span class="keyword">bool</span> match(<span class="keyword">string</span> pattern)</code></h4>
@@ -373,7 +373,7 @@ <h4 id="array-indexer"> <code><span class="keyword">any</span> [<span class="key
373373
<p>
374374
Returns the item at the given index, or <code><span class="keyword">none</span></code> if the index is out of range. Negative indexes start counting from the end of the array. For example, <code>-1</code> will return the last item in the array.</p>
375375
<p>
376-
For example, <code>['A, 'B', 'C'][1]</code> returns <code>'B'</code>.</p>
376+
For example, <code>['A', 'B', 'C'][1]</code> returns <code>'B'</code>.</p>
377377
<h3 id="array-member-functions"> Member functions</h3>
378378
<ul>
379379
<li>
@@ -472,7 +472,7 @@ <h4 id="array-last"> <code><span class="keyword">any</span> last()</code></h4>
472472
<p>
473473
Returns the last item from the array, or <code><span class="keyword">none</span></code> if the array is empty.</p>
474474
<p>
475-
For example, <code>['A', 'B', 'C'].first()</code> returns <code>'C'</code>.</p>
475+
For example, <code>['A', 'B', 'C'].last()</code> returns <code>'C'</code>.</p>
476476
<hr>
477477
<h4 id="array-concat"> <code><span class="keyword">array</span> concat(<span class="keyword">array</span> other)</code></h4>
478478
<p>
@@ -556,7 +556,7 @@ <h4 id="array-zip"> <code><span class="keyword">array</span> zip(<span class="ke
556556
<p>
557557
<code>zipper</code> must be a function that takes two arguments: <code>(<span class="keyword">any</span> value, <span class="keyword">any</span> otherValue) => <span class="keyword">any</span></code>.</p>
558558
<p>
559-
For example, <code>[1, 2, 3, 4].zip(['A', 'B', 'C'].zip((n, s) => n + s)</code> returns <code>['1A', '2B', '3C']</code>.</p>
559+
For example, <code>[1, 2, 3, 4].zip(['A', 'B', 'C'], (n, s) => n + s)</code> returns <code>['1A', '2B', '3C']</code>.</p>
560560
<hr>
561561
<h4 id="array-sort"> <code><span class="keyword">array</span> sort(<span class="keyword">function</span> sort_by)</code></h4>
562562
<p>
@@ -586,7 +586,7 @@ <h4 id="array-all"> <code><span class="keyword">bool</span> all(<span class="key
586586
<p>
587587
<code>predicate</code> can either be <code><span class="keyword">none</span></code>, or a function that takes one argument: <code>(<span class="keyword">any</span> value) => <span class="keyword">bool</span></code>.</p>
588588
<p>
589-
For example, <code>[4, 5, 6].<span class="keyword">any</span>(n => n > 5)</code> returns <code><span class="keyword">none</span></code> (false).</p>
589+
For example, <code>[4, 5, 6].all(n => n > 5)</code> returns <code><span class="keyword">none</span></code> (false).</p>
590590
<hr>
591591
<h4 id="numerical">Numerical</h4>
592592
<h4 id="array-max"> <code><span class="keyword">number</span>|<span class="keyword">none</span> max(funtion selector = <span class="keyword">none</span>)</code></h4>

docs/standard-functions.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ <h4 id="ord"><code><span class="keyword">number</span> ord(<span class="keyword"
377377
<p>
378378
Returns the numeric Unicode value of a specific character in the given string. The first character is chosen if no index is provided. Returns <code><span class="keyword">none</span></code> if the index is out of range or if the given string is <code><span class="keyword">none</span></code>.</p>
379379
<p>
380-
For example, <code>ord('a')</code> returns <code>97</code>, and <code>ord(4)</code> returns <code>52</code>.</p>
380+
For example, <code>ord('a')</code> returns <code>97</code>, and <code>ord('4')</code> returns <code>52</code>.</p>
381381
<hr>
382382
<h4 id="chr"><code><span class="keyword">string</span> chr(<span class="keyword">number</span> value)</code></h4>
383383
<p>
@@ -485,7 +485,7 @@ <h4 id="func_arg"><code><span class="keyword">object</span> func_arg(<span class
485485
<p>
486486
Returns an object with information about the specified function parameter, or <code><span class="keyword">none</span></code> if the given function is <code><span class="keyword">none</span></code> or if the parameter does not exist.</p>
487487
<p>
488-
For example, <code>func_arg(range, 'step')</code> returns <code>{name: 'step', type: 'Number', optional: 1, default_value: <span class="keyword">none</span>}</code>.</p>
488+
For example, <code>func_arg(range, 'step')</code> returns <code>{name: 'step', type: '<span class="keyword">number</span>', optional: 1, default_value: <span class="keyword">none</span>}</code>.</p>
489489
<hr>
490490
<h4 id="func_apply"><code><span class="keyword">object</span> func_apply(<span class="keyword">function</span> func, <span class="keyword">array</span> arguments)</code></h4>
491491
<p>
@@ -502,7 +502,7 @@ <h4 id="color"><code><span class="keyword">array</span> color(<span class="keywo
502502
<p>
503503
Returns an array of 3 values (red, green and blue) if the given array contains 3 values or less. Returns an array of 4 values (red, green, blue and brightness) if the given array contains 4 values or more. The first 3 values are clamped to the 0-255 range (inclusive), and all values are rounded to the nearest integer value. If a value can't be converted or is missing, <code>0</code> is used instead. This function can be used to 'sanitize' colors.</p>
504504
<p>
505-
For example, <code>color('100', 300, 150.4)</code> returns <code>[100, 255, 150]</code>.</p>
505+
For example, <code>color(['100', 300, 150.4])</code> returns <code>[100, 255, 150]</code>.</p>
506506
<h2 id="debugging">7.4.10. Debugging</h2>
507507
<ul>
508508
<li>

docs/template-functions.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ <h4 id="rand"><code><span class="keyword">number</span> rand()</code><br/><code>
181181
<li>
182182
<code>rand(5)</code> will return a random number between <code>0</code> and <code>5</code> (but not exactly <code>5</code>)</li>
183183
<li>
184-
<code>rand(2, 4)</code> will return a random number between <code>2</code> and <code>4</code> (but not exactly <code>2</code>)</li>
184+
<code>rand(2, 4)</code> will return a random number between <code>2</code> and <code>4</code> (but not exactly <code>4</code>)</li>
185185
<li>
186186
<code>rand(0, 2, 0.5)</code> will return either <code>0</code>, <code>0.5</code>, <code>1</code> or <code>1.5</code> (but not <code>2</code>)</li>
187187
</ul>

0 commit comments

Comments
 (0)