Update BazzBasic-AI-guide-01-05-2026.txt
Browse files
BazzBasic-AI-guide-01-05-2026.txt
CHANGED
|
@@ -767,24 +767,24 @@ Load all sounds at startup. Call `SOUNDSTOPALL` before `END`.
|
|
| 767 |
## File I/O
|
| 768 |
|
| 769 |
```basic
|
| 770 |
-
LET data$ =
|
| 771 |
-
DIM cfg$ : LET cfg$ =
|
| 772 |
FILEWRITE "save.txt", data$ ' Create/overwrite
|
| 773 |
FILEAPPEND "log.txt", entry$ ' Append
|
| 774 |
LET ok$ = FILEEXISTS("file.txt") ' 1=exists, 0=not
|
| 775 |
FILEDELETE "temp.dat" ' Delete file
|
| 776 |
```
|
| 777 |
|
| 778 |
-
**key=value parsing:** When `
|
| 779 |
|
| 780 |
```basic
|
| 781 |
DIM env$
|
| 782 |
-
LET env$ =
|
| 783 |
LET API_KEY# = env$("OPENAI_API_KEY")
|
| 784 |
```
|
| 785 |
|
| 786 |
**Paths:** Use `/` or `\\` never single `\` (it's an escape char). Relative paths are from `PRG_ROOT#`.
|
| 787 |
-
**
|
| 788 |
|
| 789 |
---
|
| 790 |
|
|
@@ -1020,7 +1020,7 @@ Things to be aware of most are deliberate design decisions, a few are practical
|
|
| 1020 |
|
| 1021 |
---
|
| 1022 |
|
| 1023 |
-
## IDE Features (v1.
|
| 1024 |
|
| 1025 |
### New File Template
|
| 1026 |
When the IDE opens with no file (or a new file), this template is auto-inserted:
|
|
|
|
| 767 |
## File I/O
|
| 768 |
|
| 769 |
```basic
|
| 770 |
+
LET data$ = FILEREAD("file.txt") ' Read as string
|
| 771 |
+
DIM cfg$ : LET cfg$ = FILEREAD("settings.txt") ' Read as key=value array
|
| 772 |
FILEWRITE "save.txt", data$ ' Create/overwrite
|
| 773 |
FILEAPPEND "log.txt", entry$ ' Append
|
| 774 |
LET ok$ = FILEEXISTS("file.txt") ' 1=exists, 0=not
|
| 775 |
FILEDELETE "temp.dat" ' Delete file
|
| 776 |
```
|
| 777 |
|
| 778 |
+
**key=value parsing:** When `FILEREAD` assigns to a `DIM`'d array, lines `key=value` become `arr$("key")`. Lines starting with `#` are comments. Perfect for `.env` files.
|
| 779 |
|
| 780 |
```basic
|
| 781 |
DIM env$
|
| 782 |
+
LET env$ = FILEREAD(".env")
|
| 783 |
LET API_KEY# = env$("OPENAI_API_KEY")
|
| 784 |
```
|
| 785 |
|
| 786 |
**Paths:** Use `/` or `\\` never single `\` (it's an escape char). Relative paths are from `PRG_ROOT#`.
|
| 787 |
+
**FILEWRITE with array** saves in key=value format (round-trips with FILEREAD).
|
| 788 |
|
| 789 |
---
|
| 790 |
|
|
|
|
| 1020 |
|
| 1021 |
---
|
| 1022 |
|
| 1023 |
+
## IDE Features (v1.4)
|
| 1024 |
|
| 1025 |
### New File Template
|
| 1026 |
When the IDE opens with no file (or a new file), this template is auto-inserted:
|