From 2661acf8a7bfbe263578076021592da606f5a5dc Mon Sep 17 00:00:00 2001
From: Joerg Siebenmorgen
Date: Sat, 15 Nov 2025 14:13:14 +0100
Subject: [PATCH] Update undocumented features
---
_build/pages/guide.markdown | 1 +
_build/reference/1442-system-option.markdown | 1 +
_build/reference/790-string-replace.markdown | 4 ++--
pages/guide.html | 4 +++-
reference/1442.html | 24 ++++++++++++--------
reference/790.html | 17 +++++++++-----
6 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/_build/pages/guide.markdown b/_build/pages/guide.markdown
index 3c8664f7..e3921d64 100644
--- a/_build/pages/guide.markdown
+++ b/_build/pages/guide.markdown
@@ -1917,6 +1917,7 @@ with this library and SmallBASIC must be linked against it.
(`\`)
- `ANTIALIAS on,off` : Enable/Disable anti-aliasing for drawing commands like
`CIRCLE` or `LINE`
+- `OPTION PREDEF AUTOLOCAL`: All variables are local by default
`OPTION PREDEF` is a compile-time option.
diff --git a/_build/reference/1442-system-option.markdown b/_build/reference/1442-system-option.markdown
index 1428837d..5bf0a559 100644
--- a/_build/reference/1442-system-option.markdown
+++ b/_build/reference/1442-system-option.markdown
@@ -14,3 +14,4 @@ Used to pass parameters to the run-time environment.
| OPTION PREDEF GRMODE [WIDTHxHEIGHT[xBPP]] | Sets the graphics mode flag (-g option) or sets the preferred screen resolution. Example: `OPTION PREDEF GRMODE 320x320x16`
| OPTION PREDEF TEXTMODE | Sets the text mode flag (-g- option)
| OPTION PREDEF CSTR | Sets as default string style the C-style special character encoding (`\`)
+| OPTION PREDEF AUTOLOCAL | All variables are local by default
diff --git a/_build/reference/790-string-replace.markdown b/_build/reference/790-string-replace.markdown
index a7f1d64d..b1de7891 100644
--- a/_build/reference/790-string-replace.markdown
+++ b/_build/reference/790-string-replace.markdown
@@ -2,7 +2,7 @@
> s = REPLACE (source, pos, str [, len])
-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`.
+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.
### Example 1:
@@ -11,6 +11,7 @@ print replace("abcdef", 3, "1") ' Output: ab1def
print replace("abcdef", 3, "12") ' Output: ab12ef
print replace("abcdef", 3, "123") ' Output: ab123f
print replace("abcdef", 3, "1234") ' Output: ab1234
+print replace("abcdef", 3, 1234) ' Output: ab1234 <- number 1234 is interpreted as string "1234"
print replace("abcdef", 3, "1234", 0) ' Output: ab1234cdef <- inserted, no replacement
print replace("abcdef", 3, "1234", 1) ' Output: ab1234def <- only c was replaced
print replace("abcdef", 3, "1234", 2) ' Output: ab1234ef <- only cd was replaced
@@ -68,4 +69,3 @@ cls
? lset("Create TEXT"); colors(Replace("", 1, TEXT))
```
-
diff --git a/pages/guide.html b/pages/guide.html
index 80d428bb..7bc52182 100644
--- a/pages/guide.html
+++ b/pages/guide.html
@@ -1935,6 +1935,8 @@ OPTION PREDEF
character encoding (\)
ANTIALIAS on,off : Enable/Disable anti-aliasing for
drawing commands like CIRCLE or LINE
+OPTION PREDEF AUTOLOCAL: All variables are local by
+default
OPTION PREDEF is a compile-time option.
@@ -1997,7 +1999,7 @@ Exception Handling
href="https://smallbasic.github.io/reference/1425.html">TRY.
diff --git a/reference/790.html b/reference/790.html
index b6d8870e..b314208b 100644
--- a/reference/790.html
+++ b/reference/790.html
@@ -49,17 +49,20 @@ REPLACE
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.
+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.
Example 1:
print replace("abcdef", 3, "1") ' Output: ab1def
print replace("abcdef", 3, "12") ' Output: ab12ef
print replace("abcdef", 3, "123") ' Output: ab123f
print replace("abcdef", 3, "1234") ' Output: ab1234
-print replace("abcdef", 3, "1234", 0) ' Output: ab1234cdef <- inserted, no replacement
-print replace("abcdef", 3, "1234", 1) ' Output: ab1234def <- only c was replaced
-print replace("abcdef", 3, "1234", 2) ' Output: ab1234ef <- only cd was replaced
-print replace("abcdef", 3, "", len("abcdef")) ' Output: ab <- cut
+print replace("abcdef", 3, 1234) ' Output: ab1234 <- number 1234 is interpreted as string "1234"
+print replace("abcdef", 3, "1234", 0) ' Output: ab1234cdef <- inserted, no replacement
+print replace("abcdef", 3, "1234", 1) ' Output: ab1234def <- only c was replaced
+print replace("abcdef", 3, "1234", 2) ' Output: ab1234ef <- only cd was replaced
+print replace("abcdef", 3, "", len("abcdef")) ' Output: ab <- cut
Example 2:
Const TEXT = "Red Green Blue" ' Text to replace:
@@ -113,7 +116,9 @@ Example 2: