Skip to content

Commit 1e5551d

Browse files
authored
Merge pull request #46 from Joe7M/master
Update undocumented features
2 parents f059971 + 2661acf commit 1e5551d

File tree

6 files changed

+32
-19
lines changed

6 files changed

+32
-19
lines changed

_build/pages/guide.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,6 +1917,7 @@ with this library and SmallBASIC must be linked against it.
19171917
(`\`)
19181918
- `ANTIALIAS on,off` : Enable/Disable anti-aliasing for drawing commands like
19191919
`CIRCLE` or `LINE`
1920+
- `OPTION PREDEF AUTOLOCAL`: All variables are local by default
19201921

19211922
`OPTION PREDEF` is a compile-time option.
19221923

_build/reference/1442-system-option.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Used to pass parameters to the run-time environment.
1414
| OPTION PREDEF GRMODE [WIDTHxHEIGHT[xBPP]] | Sets the graphics mode flag (-g option) or sets the preferred screen resolution. Example: `OPTION PREDEF GRMODE 320x320x16`
1515
| OPTION PREDEF TEXTMODE | Sets the text mode flag (-g- option)
1616
| OPTION PREDEF CSTR | Sets as default string style the C-style special character encoding (`\`)
17+
| OPTION PREDEF AUTOLOCAL | All variables are local by default

_build/reference/790-string-replace.markdown

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

33
> s = REPLACE (source, pos, str [, len])
44
5-
Writes the string `str` into string `source` at position `pos` and returns the new string. This function replaces `len` characters. The default value of `len` is the length of `str`.
5+
Writes the string `str` into string `source` at position `pos` and returns the new string. This function replaces `len` characters. The default value of `len` is the length of `str`. Instead of a string, a number can be passed as a parameter. The number will be interpreted as a string.
66

77
### Example 1:
88

@@ -11,6 +11,7 @@ print replace("abcdef", 3, "1") ' Output: ab1def
1111
print replace("abcdef", 3, "12") ' Output: ab12ef
1212
print replace("abcdef", 3, "123") ' Output: ab123f
1313
print replace("abcdef", 3, "1234") ' Output: ab1234
14+
print replace("abcdef", 3, 1234) ' Output: ab1234 <- number 1234 is interpreted as string "1234"
1415
print replace("abcdef", 3, "1234", 0) ' Output: ab1234cdef <- inserted, no replacement
1516
print replace("abcdef", 3, "1234", 1) ' Output: ab1234def <- only c was replaced
1617
print replace("abcdef", 3, "1234", 2) ' Output: ab1234ef <- only cd was replaced
@@ -68,4 +69,3 @@ cls
6869
? lset("Create TEXT"); colors(Replace("", 1, TEXT))
6970
```
7071

71-

pages/guide.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,8 @@ <h3 id="Statement4">OPTION PREDEF</h3>
19351935
character encoding (<code>\</code>)</li>
19361936
<li><code>ANTIALIAS on,off</code> : Enable/Disable anti-aliasing for
19371937
drawing commands like <code>CIRCLE</code> or <code>LINE</code></li>
1938+
<li><code>OPTION PREDEF AUTOLOCAL</code>: All variables are local by
1939+
default</li>
19381940
</ul>
19391941
<p><code>OPTION PREDEF</code> is a compile-time option.</p>
19401942
<h2 id="Meta">Meta Commands</h2>
@@ -1997,7 +1999,7 @@ <h2 id="ExceptionHandling">Exception Handling</h2>
19971999
href="https://smallbasic.github.io/reference/1425.html">TRY</a>.</p>
19982000
</div>
19992001
<div class="pagefooter">
2000-
This page was last edited on Tue, 2 Sep 2025 21:28:15 +0200
2002+
This page was last edited on Mon, 10 Nov 2025 22:46:08 +0100
20012003
|
20022004
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
20032005
processed with

reference/1442.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,53 +53,57 @@ <h1>OPTION</h1>
5353
<col style="width: 50%" />
5454
</colgroup>
5555
<thead>
56-
<tr class="header">
56+
<tr>
5757
<th style="text-align: left;">Option</th>
5858
<th style="text-align: left;">Description</th>
5959
</tr>
6060
</thead>
6161
<tbody>
62-
<tr class="odd">
62+
<tr>
6363
<td style="text-align: left;">OPTION BASE 0,1</td>
6464
<td style="text-align: left;">Set lowest allowed index of arrays to 0 or
6565
1</td>
6666
</tr>
67-
<tr class="even">
67+
<tr>
6868
<td style="text-align: left;">OPTION PREDEF ANTIALIAS on,off</td>
6969
<td style="text-align: left;">Set anti-aliasing for drawing lines or
7070
circles</td>
7171
</tr>
72-
<tr class="odd">
72+
<tr>
7373
<td style="text-align: left;">OPTION MATCH PCRE [CASELESS]SIMPLE</td>
7474
<td style="text-align: left;">Set matching algorithm to
7575
(P)erl-(C)ompatible (R)egular (E)xpressions library or back to simple
7676
one for LIKE and FILES</td>
7777
</tr>
78-
<tr class="even">
78+
<tr>
7979
<td style="text-align: left;">OPTION PREDEF QUIET</td>
8080
<td style="text-align: left;">Sets the quiet flag (-q option)</td>
8181
</tr>
82-
<tr class="odd">
82+
<tr>
8383
<td style="text-align: left;">OPTION PREDEF COMMAND cmdstr</td>
8484
<td style="text-align: left;">Sets the COMMAND$ string to cmdstr (useful
8585
for debug reasons)</td>
8686
</tr>
87-
<tr class="even">
87+
<tr>
8888
<td style="text-align: left;">OPTION PREDEF GRMODE
8989
[WIDTHxHEIGHT[xBPP]]</td>
9090
<td style="text-align: left;">Sets the graphics mode flag (-g option) or
9191
sets the preferred screen resolution. Example:
9292
<code>OPTION PREDEF GRMODE 320x320x16</code></td>
9393
</tr>
94-
<tr class="odd">
94+
<tr>
9595
<td style="text-align: left;">OPTION PREDEF TEXTMODE</td>
9696
<td style="text-align: left;">Sets the text mode flag (-g- option)</td>
9797
</tr>
98-
<tr class="even">
98+
<tr>
9999
<td style="text-align: left;">OPTION PREDEF CSTR</td>
100100
<td style="text-align: left;">Sets as default string style the C-style
101101
special character encoding (<code>\</code>)</td>
102102
</tr>
103+
<tr>
104+
<td style="text-align: left;">OPTION PREDEF AUTOLOCAL</td>
105+
<td style="text-align: left;">All variables are local by default</td>
106+
</tr>
103107
</tbody>
104108
</table>
105109
<div class="lavenderBox">
@@ -173,7 +177,7 @@ <h1>OPTION</h1>
173177
|
174178
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
175179
processed with
176-
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
180+
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.2.1</a>
177181
</div>
178182
</div>
179183
</div>

reference/790.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,20 @@ <h1>REPLACE</h1>
4949
<p>Writes the string <code>str</code> into string <code>source</code> at
5050
position <code>pos</code> and returns the new string. This function
5151
replaces <code>len</code> characters. The default value of
52-
<code>len</code> is the length of <code>str</code>.</p>
52+
<code>len</code> is the length of <code>str</code>. Instead of a string,
53+
a number can be passed as a parameter. The number will be interpreted as
54+
a string.</p>
5355
<h3 id="example-1">Example 1:</h3>
5456
<div class="sourceCode" id="cb1"><pre
5557
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1&quot;</span>) <span class="co">&#39; Output: ab1def</span></span>
5658
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;12&quot;</span>) <span class="co">&#39; Output: ab12ef</span></span>
5759
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;123&quot;</span>) <span class="co">&#39; Output: ab123f</span></span>
5860
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>) <span class="co">&#39; Output: ab1234</span></span>
59-
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>, <span class="dv">0</span>) <span class="co">&#39; Output: ab1234cdef &lt;- inserted, no replacement</span></span>
60-
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>, <span class="dv">1</span>) <span class="co">&#39; Output: ab1234def &lt;- only c was replaced</span></span>
61-
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>, <span class="dv">2</span>) <span class="co">&#39; Output: ab1234ef &lt;- only cd was replaced</span></span>
62-
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;&quot;</span>, <span class="fu">len</span>(<span class="st">&quot;abcdef&quot;</span>)) <span class="co">&#39; Output: ab &lt;- cut</span></span></code></pre></div>
61+
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="dv">1234</span>) <span class="co">&#39; Output: ab1234 &lt;- number 1234 is interpreted as string &quot;1234&quot;</span></span>
62+
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>, <span class="dv">0</span>) <span class="co">&#39; Output: ab1234cdef &lt;- inserted, no replacement</span></span>
63+
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>, <span class="dv">1</span>) <span class="co">&#39; Output: ab1234def &lt;- only c was replaced</span></span>
64+
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;1234&quot;</span>, <span class="dv">2</span>) <span class="co">&#39; Output: ab1234ef &lt;- only cd was replaced</span></span>
65+
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a><span class="kw">print</span> <span class="fu">replace</span>(<span class="st">&quot;abcdef&quot;</span>, <span class="dv">3</span>, <span class="st">&quot;&quot;</span>, <span class="fu">len</span>(<span class="st">&quot;abcdef&quot;</span>)) <span class="co">&#39; Output: ab &lt;- cut</span></span></code></pre></div>
6366
<h3 id="example-2">Example 2:</h3>
6467
<div class="sourceCode" id="cb2"><pre
6568
class="sourceCode smallbasic"><code class="sourceCode smallbasic"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="dt">Const</span> TEXT = <span class="st">&quot;Red Green Blue&quot;</span> <span class="co">&#39; Text to replace:</span></span>
@@ -113,7 +116,9 @@ <h3 id="example-2">Example 2:</h3>
113116
<div class="linklist">
114117
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 2/3d rotating cube with message.bas">3d rotating cube with message.bas </a>&nbsp;
115118
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/anball 1.0.bas">anball 1.0.bas </a>&nbsp;
119+
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/checkers.bas">checkers.bas </a>&nbsp;
116120
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/checkers.bas">checkers.bas </a>&nbsp;
121+
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 1/chess.bas">chess.bas </a>&nbsp;
117122
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 3/chess.bas">chess.bas </a>&nbsp;
118123
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/graphics 1/conrec-sb-v01.bas">conrec-sb-v01.bas </a>&nbsp;
119124
<a target="_github" href="https://raw.githubusercontent.com/smallbasic/smallbasic.samples/master/games 2/hangman v2.bas">hangman v2.bas </a>&nbsp;
@@ -184,7 +189,7 @@ <h3 id="example-2">Example 2:</h3>
184189
|
185190
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
186191
processed with
187-
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.1.12.1</a>
192+
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.2.1</a>
188193
</div>
189194
</div>
190195
</div>

0 commit comments

Comments
 (0)