From 3864ca10b9995526145ce87f3d606437a2e30ce0 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Wed, 13 May 2026 11:57:49 +0200 Subject: [PATCH 1/3] Improve the VB package orientation page. --- docs/Reference/VB/index.md | 46 +++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/docs/Reference/VB/index.md b/docs/Reference/VB/index.md index f380fe22..65e99fbc 100644 --- a/docs/Reference/VB/index.md +++ b/docs/Reference/VB/index.md @@ -2,9 +2,53 @@ title: VB Package parent: Reference Section nav_order: 21 -permalink: /tB/Packages/VB +permalink: /tB/Packages/VB/ +has_toc: false --- # VB Package These classes are in the VB built-in package, which provides the standard set of controls (CheckBox, CommandButton, ComboBox, Label, TextBox, …) and the form infrastructure that hosts them. + +## Classes + +### Non-Controls + +- [App](App) -- singleton wrapping the running application's identity, version metadata, and process-level state +- [Clipboard](Clipboard) -- singleton wrapper around the system clipboard for inter-application copy and paste +- [Global](Global) -- the application's app object — singleton whose members (**App**, **Screen**, **Clipboard**, **Forms**, …) are reachable without qualification +- [Printer](Printer) -- drawing-surface wrapper around one Windows printer device, recording graphics calls into a spooled print job +- [Printers](Printers) -- read-only collection of every printer installed on the system +- [Screen](Screen) -- singleton wrapping the primary display's metrics, font list, active form and control, and application-wide mouse pointer + +### Controls + +- [CheckBox](CheckBox) -- Win32 native two- or three-state check-box with a caption and optional keyboard mnemonic +- [CheckMark](CheckMark) -- windowless scalable check glyph with no caption or focus — a check-box rendered at any size +- [ComboBox](ComboBox) -- Win32 native edit field combined with a drop-down list of items +- [CommandButton](CommandButton) -- Win32 native push-button that triggers an action when clicked +- [Data](Data) -- Win32 native control that opens a DAO database and exposes a bound recordset to other controls +- [DirListBox](DirListBox) -- Win32 native list of a directory's ancestors and immediate subdirectories +- [DriveListBox](DriveListBox) -- Win32 native drop-down combo auto-populated with the system's drives +- [FileListBox](FileListBox) -- Win32 native list of files in a directory, filtered by pattern and attributes +- [Form](Form) -- top-level Win32 window that hosts the controls, menus, and drawing surface of a single user interface +- [Frame](Frame) -- Win32 native captioned container that groups controls and forms an option-button group +- [HScrollBar](HScrollBar) -- Win32 native stand-alone horizontal scroll bar +- [Image](Image) -- windowless lightweight picture display — the cheap alternative to **PictureBox** +- [Label](Label) -- windowless lightweight control for displaying read-only text and keyboard-mnemonic anchors +- [Line](Line) -- windowless lightweight control that draws a single straight line segment between two endpoints +- [ListBox](ListBox) -- Win32 native vertically-scrolling list of items, single- or multi-select +- [MDIForm](MDIForm) -- top-level window that hosts an MDI client area for **Form** instances marked as MDI children +- [Menu](Menu) -- a single item — top-level entry, sub-menu entry, or separator — in a Win32 native menu +- [MultiFrame](MultiFrame) -- layout container that arranges **Frame** controls in a horizontal or vertical strip +- [OLE](OLE) -- container that hosts a linked or embedded OLE Automation object (VB6 compatibility stub — mostly unimplemented) +- [OptionButton](OptionButton) -- Win32 native round selector, mutually exclusive within its container +- [PictureBox](PictureBox) -- Win32 native picture display, drawing surface, and control container combined +- [PropertyPage](PropertyPage) -- container backing a single tab of a COM property-page dialog +- [QRCode](QRCode) -- windowless lightweight control that renders a QR code generated from its payload +- [Report](Report) -- top-level window specialised for rendering the print preview of a banded recordset report +- [Shape](Shape) -- windowless lightweight control that draws one of a fixed set of geometric primitives +- [TextBox](TextBox) -- Win32 native edit control for single- or multi-line text entry +- [Timer](Timer) -- non-visual control that raises a **Timer** event at a programmable interval +- [UserControl](UserControl) -- base class for designing a reusable ActiveX control +- [VScrollBar](VScrollBar) -- Win32 native stand-alone vertical scroll bar From d42c49eb117c58e2dde062866e35f26af454791f Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Wed, 13 May 2026 12:41:23 +0200 Subject: [PATCH 2/3] Improve the VBA package organization. --- docs/Features/Standard-Library/File-IO.md | 2 +- .../Documentation Development.md | 1 - docs/Reference/Categories.md | 16 +-- docs/Reference/Core/Input.md | 4 +- docs/Reference/Core/Open.md | 91 ++++++++++++++- docs/Reference/Procedures and Functions.md | 14 +-- docs/Reference/VBA/Collection/Add.md | 2 +- docs/Reference/VBA/Collection/Clear.md | 2 +- docs/Reference/VBA/Collection/Count.md | 2 +- docs/Reference/VBA/Collection/Exists.md | 2 +- docs/Reference/VBA/Collection/Item.md | 2 +- docs/Reference/VBA/Collection/Items.md | 2 +- .../VBA/Collection/KeyCompareMode.md | 2 +- docs/Reference/VBA/Collection/KeyCountHint.md | 2 +- docs/Reference/VBA/Collection/Keys.md | 2 +- docs/Reference/VBA/Collection/Remove.md | 2 +- docs/Reference/VBA/Collection/index.md | 5 +- docs/Reference/VBA/ErrObject/Clear.md | 2 +- docs/Reference/VBA/ErrObject/Description.md | 2 +- docs/Reference/VBA/ErrObject/HelpContext.md | 2 +- docs/Reference/VBA/ErrObject/HelpFile.md | 2 +- docs/Reference/VBA/ErrObject/LastDllError.md | 2 +- docs/Reference/VBA/ErrObject/LastHresult.md | 2 +- docs/Reference/VBA/ErrObject/Number.md | 2 +- docs/Reference/VBA/ErrObject/Raise.md | 2 +- docs/Reference/VBA/ErrObject/ReturnHResult.md | 2 +- docs/Reference/VBA/ErrObject/Source.md | 2 +- docs/Reference/VBA/ErrObject/index.md | 5 +- .../VBA/{HiddenModule => FileSystem}/Input.md | 10 +- .../{HiddenModule => FileSystem}/InputB.md | 8 +- .../VBA/{HiddenModule => FileSystem}/Width.md | 7 +- docs/Reference/VBA/FileSystem/index.md | 11 +- docs/Reference/VBA/HiddenModule/Eval.md | 4 +- docs/Reference/VBA/HiddenModule/index.md | 29 +---- .../{HiddenModule => Information}/Array.md | 7 +- .../{HiddenModule => Information}/ObjPtr.md | 6 +- .../{HiddenModule => Information}/StrPtr.md | 6 +- .../{HiddenModule => Information}/VarPtr.md | 6 +- docs/Reference/VBA/Information/index.md | 27 ++++- .../AddCustomBinder.md | 6 +- .../AddCustomBinderObject.md | 6 +- .../AddStdLibraryBinder.md | 6 +- .../Bind.md | 6 +- .../Compile.md | 6 +- .../Evaluate.md | 6 +- .../index.md | 13 ++- .../VBA/TextEncodingConstants/index.md | 104 ------------------ docs/Reference/VBA/index.md | 27 ++++- 48 files changed, 263 insertions(+), 216 deletions(-) rename docs/Reference/VBA/{HiddenModule => FileSystem}/Input.md (79%) rename docs/Reference/VBA/{HiddenModule => FileSystem}/InputB.md (90%) rename docs/Reference/VBA/{HiddenModule => FileSystem}/Width.md (90%) rename docs/Reference/VBA/{HiddenModule => Information}/Array.md (93%) rename docs/Reference/VBA/{HiddenModule => Information}/ObjPtr.md (90%) rename docs/Reference/VBA/{HiddenModule => Information}/StrPtr.md (90%) rename docs/Reference/VBA/{HiddenModule => Information}/VarPtr.md (90%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/AddCustomBinder.md (92%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/AddCustomBinderObject.md (92%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/AddStdLibraryBinder.md (89%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/Bind.md (94%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/Compile.md (93%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/Evaluate.md (92%) rename docs/Reference/VBA/{ExpressionService => TbExpressionService}/index.md (88%) delete mode 100644 docs/Reference/VBA/TextEncodingConstants/index.md diff --git a/docs/Features/Standard-Library/File-IO.md b/docs/Features/Standard-Library/File-IO.md index 9f61f29d..a136c545 100644 --- a/docs/Features/Standard-Library/File-IO.md +++ b/docs/Features/Standard-Library/File-IO.md @@ -16,4 +16,4 @@ Open "C:\MyFile.txt" For Input Encoding utf_8 As #1 ## Supported Encodings -See the [TextEncodingConstants module](../../tB/Modules/TextEncodingConstants/). +See the [Text Encodings table](../../tB/Core/Open#text-encodings) on the **Open** statement reference page. diff --git a/docs/Miscellaneous/Documentation Development.md b/docs/Miscellaneous/Documentation Development.md index 58d35de8..d4b01335 100644 --- a/docs/Miscellaneous/Documentation Development.md +++ b/docs/Miscellaneous/Documentation Development.md @@ -57,7 +57,6 @@ These are modules within VBA and VBRUN: - [Interaction](../tB/Modules/Interaction) - [Math](../tB/Modules/Math) - [Strings](../tB/Modules/Strings) - - [TextEncodingConstants](../tB/Modules/TextEncodingConstants) - Internal [_HiddenModule](../tB/Modules/HiddenModule) - VBRUN - [AmbientProperties](../tB/Modules/AmbientProperties) diff --git a/docs/Reference/Categories.md b/docs/Reference/Categories.md index bcebb18b..86cbd74a 100644 --- a/docs/Reference/Categories.md +++ b/docs/Reference/Categories.md @@ -120,7 +120,7 @@ Procedures: See also: * [Dim](../tB/Core/Dim) - allocate a scalar or array variable -* [Array](../tB/Modules/HiddenModule/Array), [Filter](../tB/Modules/Strings/Filter), [Join](../tB/Modules/Strings/Join), [Split](../tB/Modules/Strings/Split) - array helpers +* [Array](../tB/Modules/Information/Array), [Filter](../tB/Modules/Strings/Filter), [Join](../tB/Modules/Strings/Join), [Split](../tB/Modules/Strings/Split) - array helpers * [vbaAryMove](../tB/Modules/HiddenModule/vbaAryMove), [vbaRefVarAry](../tB/Modules/HiddenModule/vbaRefVarAry) - low-level **Variant**-array helpers (see [Memory and Pointers](#memory-and-pointers)) ## File I/O @@ -137,9 +137,9 @@ Statements: Procedures: * [Reset](../tB/Core/Reset) - close all open disk files -* [Width](../tB/Modules/HiddenModule/Width) - set the limit for line lengths when printing -* [Input, Input$](../tB/Modules/HiddenModule/Input) - read a fixed number of characters from a sequential file -* [InputB, InputB$](../tB/Modules/HiddenModule/InputB) - read a fixed number of bytes from a sequential file +* [Width](../tB/Modules/FileSystem/Width) - set the limit for line lengths when printing +* [Input, Input$](../tB/Modules/FileSystem/Input) - read a fixed number of characters from a sequential file +* [InputB, InputB$](../tB/Modules/FileSystem/InputB) - read a fixed number of bytes from a sequential file * [ChDir](../tB/Core/ChDir), [ChDrive](../tB/Core/ChDrive) - change the current working directory and disk drive * [MkDir](../tB/Core/MkDir), [RmDir](../tB/Core/RmDir) - create/remove a directory on disk * [Name](../tB/Core/Name) - rename a file or directory on disk @@ -207,7 +207,7 @@ Procedures: See also: -* [ObjPtr](../tB/Modules/HiddenModule/ObjPtr) - return the COM-identity address of an object (see [Memory and Pointers](#memory-and-pointers)) +* [ObjPtr](../tB/Modules/Information/ObjPtr) - return the COM-identity address of an object (see [Memory and Pointers](#memory-and-pointers)) ## Command Line and Environment @@ -387,9 +387,9 @@ See also: Procedures: -* [ObjPtr](../tB/Modules/HiddenModule/ObjPtr) - return the COM-identity address of an object -* [StrPtr](../tB/Modules/HiddenModule/StrPtr) - return the address of the underlying buffer of a **String** -* [VarPtr](../tB/Modules/HiddenModule/VarPtr) - return the address of a variable +* [ObjPtr](../tB/Modules/Information/ObjPtr) - return the COM-identity address of an object +* [StrPtr](../tB/Modules/Information/StrPtr) - return the address of the underlying buffer of a **String** +* [VarPtr](../tB/Modules/Information/VarPtr) - return the address of a variable * [AllocMem](../tB/Modules/HiddenModule/AllocMem), [FreeMem](../tB/Modules/HiddenModule/FreeMem) - allocate/release native memory blocks * [GetMem1](../tB/Modules/HiddenModule/GetMem1), [GetMem2](../tB/Modules/HiddenModule/GetMem2), [GetMem4](../tB/Modules/HiddenModule/GetMem4), [GetMem8](../tB/Modules/HiddenModule/GetMem8), [GetMemPtr](../tB/Modules/HiddenModule/GetMemPtr) - read N bytes from a memory address into a typed variable * [PutMem1](../tB/Modules/HiddenModule/PutMem1), [PutMem2](../tB/Modules/HiddenModule/PutMem2), [PutMem4](../tB/Modules/HiddenModule/PutMem4), [PutMem8](../tB/Modules/HiddenModule/PutMem8), [PutMemPtr](../tB/Modules/HiddenModule/PutMemPtr) - write a typed value of N bytes to a memory address diff --git a/docs/Reference/Core/Input.md b/docs/Reference/Core/Input.md index 0f4b1375..97e75a20 100644 --- a/docs/Reference/Core/Input.md +++ b/docs/Reference/Core/Input.md @@ -10,7 +10,7 @@ vba_attribution: true Reads data from an open sequential file and assigns the data to variables. > [!NOTE] -> This page documents the **Input #** *statement*. The unrelated [**Input** function](../Modules/HiddenModule/Input) reads a fixed number of characters from any open file. +> This page documents the **Input #** *statement*. The unrelated [**Input** function](../Modules/FileSystem/Input) reads a fixed number of characters from any open file. Syntax: > **Input** **#** *filenumber* **,** *varlist* @@ -66,5 +66,5 @@ Close #1 ' Close file. - [**Line Input #** statement](Line-Input) - [**Write #** statement](Write) - [**Print #** statement](Print) -- [**Input** function](../Modules/HiddenModule/Input) +- [**Input** function](../Modules/FileSystem/Input) - [**EOF** function](../Modules/FileSystem/EOF) diff --git a/docs/Reference/Core/Open.md b/docs/Reference/Core/Open.md index a83c0095..dc9163c3 100644 --- a/docs/Reference/Core/Open.md +++ b/docs/Reference/Core/Open.md @@ -2,6 +2,8 @@ title: Open parent: Statements permalink: /tB/Core/Open +redirect_from: + - /tB/Modules/TextEncodingConstants vba_attribution: true --- # Open @@ -25,7 +27,7 @@ Syntax: : *optional* Keyword specifying the operations restricted on the open file by other processes: **Shared**, **Lock Read**, **Lock Write**, or **Lock Read Write**. *encoding* -: *optional* An encoding identifier from the [**TextEncodingConstants**](../Modules/TextEncodingConstants/) module — for example **utf_8**, **utf_16**, **windows_1252_western**, or **default_system_ansi**. The IDE surfaces these constants automatically in IntelliSense after the **Encoding** keyword. Other system-supported encodings with similar identifier strings are also accepted at runtime. The **Encoding** clause applies to text-mode I/O (**Input**, **Output**, **Append**); it has no effect on **Binary** or **Random** mode files. +: *optional* An encoding identifier — for example **utf_8**, **utf_16**, **windows_1252_western**, or **default_system_ansi**. See [Text Encodings](#text-encodings) below for the full list. The **Encoding** clause applies to text-mode I/O (**Input**, **Output**, **Append**); it has no effect on **Binary** or **Random** mode files. *filenumber* : A valid file number in the range 1 to 511, inclusive. Use the [**FreeFile**](../Modules/FileSystem/FreeFile) function to obtain the next available file number. @@ -95,7 +97,7 @@ This code example opens the file in **Binary** mode for reading; other processes Open "TESTFILE" For Binary Access Read Lock Read As #1 ``` -This example reads a UTF-8 text file. The **Encoding** clause names the [TextEncodingConstants](../Modules/TextEncodingConstants/) constant for UTF-8. +This example reads a UTF-8 text file, naming the [**utf_8**](#utf_8) encoding identifier. ```tb Open "C:\MyFile.txt" For Input Encoding utf_8 As #1 @@ -103,6 +105,90 @@ Open "C:\MyFile.txt" For Input Encoding utf_8 As #1 Close #1 ``` +### Text Encodings + +These identifier strings are accepted as the **Encoding** argument. The constants listed below name the well-known encodings; other system-supported encodings with similar identifier strings are also accepted at runtime. All members are marked **[Hidden, Restricted]** — they are omitted from general IntelliSense, but the IDE surfaces them automatically after the **Encoding** keyword. + +#### Default and Unicode + +| Constant | Value | Description | +|----------|-------|-------------| +| **default_system_ansi**{: #default_system_ansi } | `"default"` | The system default ANSI code page. | +| **utf_7**{: #utf_7 } | `"utf-7"` | UTF-7. | +| **utf_7_bom**{: #utf_7_bom } | `"utf-7 bom"` | UTF-7 with byte-order mark. | +| **utf_8**{: #utf_8 } | `"utf-8"` | UTF-8. | +| **utf_8_bom**{: #utf_8_bom } | `"utf-8 bom"` | UTF-8 with byte-order mark. | +| **utf_16**{: #utf_16 } | `"utf-16"` | UTF-16 (little-endian). | +| **utf_16_bom**{: #utf_16_bom } | `"utf-16 bom"` | UTF-16 with byte-order mark. | +| **us_ascii**{: #us_ascii } | `"us-ascii"` | 7-bit US-ASCII. | + +#### KOI8 (Cyrillic) + +| Constant | Value | Description | +|----------|-------|-------------| +| **koi8_r**{: #koi8_r } | `"koi8_r"` | KOI8-R, Russian. | +| **koi8_u**{: #koi8_u } | `"koi8_u"` | KOI8-U, Ukrainian. | + +#### Big5 + +| Constant | Value | Description | +|----------|-------|-------------| +| **big5**{: #big5 } | `"big5"` | Big5, Traditional Chinese. | + +#### ISO 8859 + +| Constant | Value | Description | +|----------|-------|-------------| +| **iso_8859_1_latin1**{: #iso_8859_1_latin1 } | `"iso-8859-1"` | Latin-1, Western European. | +| **iso_8859_2_latin2**{: #iso_8859_2_latin2 } | `"iso-8859-2"` | Latin-2, Central European. | +| **iso_8859_3_latin3**{: #iso_8859_3_latin3 } | `"iso-8859-3"` | Latin-3, South European (Esperanto, Maltese). | +| **iso_8859_4_latin4**{: #iso_8859_4_latin4 } | `"iso-8859-4"` | Latin-4, North European. | +| **iso_8859_5_cyrillic**{: #iso_8859_5_cyrillic } | `"iso-8859-5"` | Cyrillic. | +| **iso_8859_6_arabic**{: #iso_8859_6_arabic } | `"iso-8859-6"` | Arabic. | +| **iso_8859_7_greek**{: #iso_8859_7_greek } | `"iso-8859-7"` | Greek. | +| **iso_8859_8_hebrew**{: #iso_8859_8_hebrew } | `"iso-8859-8"` | Hebrew. | +| **iso_8859_9_latin5_turkish**{: #iso_8859_9_latin5_turkish } | `"iso-8859-9"` | Latin-5, Turkish. | +| **iso_8859_10_latin6_nordic**{: #iso_8859_10_latin6_nordic } | `"iso-8859-10"` | Latin-6, Nordic. | +| **iso_8859_11_thai**{: #iso_8859_11_thai } | `"iso-8859-11"` | Thai. | +| **iso_8859_13_latin8_baltic**{: #iso_8859_13_latin8_baltic } | `"iso-8859-13"` | Latin-7, Baltic Rim. | +| **iso_8859_14_latin8_celtic**{: #iso_8859_14_latin8_celtic } | `"iso-8859-14"` | Latin-8, Celtic. | +| **iso_8859_15_latin9_euro**{: #iso_8859_15_latin9_euro } | `"iso-8859-15"` | Latin-9, Western European with euro sign. | +| **iso_8859_16_latin10_balkan**{: #iso_8859_16_latin10_balkan } | `"iso-8859-16"` | Latin-10, South-Eastern European. | + +#### Windows code pages + +| Constant | Value | Description | +|----------|-------|-------------| +| **windows_1250_central_europe**{: #windows_1250_central_europe } | `"windows-1250"` | Central European. | +| **windows_1251_cyrillic**{: #windows_1251_cyrillic } | `"windows-1251"` | Cyrillic. | +| **windows_1252_western**{: #windows_1252_western } | `"windows-1252"` | Western European. | +| **windows_1253_greek**{: #windows_1253_greek } | `"windows-1253"` | Greek. | +| **windows_1254_turkish**{: #windows_1254_turkish } | `"windows-1254"` | Turkish. | +| **windows_1255_hebrew**{: #windows_1255_hebrew } | `"windows-1255"` | Hebrew. | +| **windows_1256_arabic**{: #windows_1256_arabic } | `"windows-1256"` | Arabic. | +| **windows_1257_baltic**{: #windows_1257_baltic } | `"windows-1257"` | Baltic. | +| **windows_1258_vietnamese**{: #windows_1258_vietnamese } | `"windows-1258"` | Vietnamese. | + +#### IBM/OEM code pages + +| Constant | Value | Description | +|----------|-------|-------------| +| **ibm_850_western_europe**{: #ibm_850_western_europe } | `"850"` | OEM Multilingual Latin-1, Western European. | +| **ibm_852_central_and_eastern_europe**{: #ibm_852_central_and_eastern_europe } | `"852"` | OEM Latin-2, Central and Eastern European. | +| **ibm_855_cyrillic**{: #ibm_855_cyrillic } | `"855"` | OEM Cyrillic (primarily pre-Unicode Russian). | +| **ibm_856_hebrew**{: #ibm_856_hebrew } | `"856"` | Hebrew. | +| **ibm_857_turkish**{: #ibm_857_turkish } | `"857"` | OEM Turkish (Latin-5). | +| **ibm_858_western_europe**{: #ibm_858_western_europe } | `"858"` | OEM Multilingual Latin-1 with euro sign. | +| **ibm_860_portuguese**{: #ibm_860_portuguese } | `"860"` | Portuguese. | +| **ibm_861_icelandic**{: #ibm_861_icelandic } | `"861"` | Icelandic. | +| **ibm_862_hebrew**{: #ibm_862_hebrew } | `"862"` | Hebrew. | +| **ibm_863_canadian**{: #ibm_863_canadian } | `"863"` | French Canadian. | +| **ibm_865_danish**{: #ibm_865_danish } | `"865"` | Nordic (Danish, Norwegian). | +| **ibm_866_cyrillic**{: #ibm_866_cyrillic } | `"866"` | Russian. | +| **ibm_869_greek**{: #ibm_869_greek } | `"869"` | Modern Greek. | +| **ibm_932_japanese**{: #ibm_932_japanese } | `"932"` | Japanese (Shift-JIS, Microsoft variant). | +| **ibm_949_korean**{: #ibm_949_korean } | `"949"` | Korean (Unified Hangul Code). | + ### See Also - [**Close** statement](Close) @@ -114,4 +200,3 @@ Close #1 - [**Write #** statement](Write) - [**Lock** / **Unlock** statements](Lock) - [**FreeFile** function](../Modules/FileSystem/FreeFile) -- [**TextEncodingConstants** module](../Modules/TextEncodingConstants/) diff --git a/docs/Reference/Procedures and Functions.md b/docs/Reference/Procedures and Functions.md index f5370451..d0175a14 100644 --- a/docs/Reference/Procedures and Functions.md +++ b/docs/Reference/Procedures and Functions.md @@ -15,7 +15,7 @@ permalink: /Reference/Procedures-and-Functions - [Abs](../tB/Modules/Math/Abs) -- returns the absolute value of a number - [AllocMem](../tB/Modules/HiddenModule/AllocMem) -- allocates a block of native memory and returns its address - [AppActivate](../tB/Modules/Interaction/AppActivate) -- activates an application window -- [Array](../tB/Modules/HiddenModule/Array) -- creates a **Variant** array from a comma-separated list of values, or destructures one when used on the left of an assignment +- [Array](../tB/Modules/Information/Array) -- creates a **Variant** array from a comma-separated list of values, or destructures one when used on the left of an assignment - [Asc, AscB, AscW](../tB/Modules/Strings/Asc) -- returns the character code of the first letter in a string - [Atn](../tB/Modules/Math/Atn) -- returns the arctangent of a number @@ -127,8 +127,8 @@ permalink: /Reference/Procedures-and-Functions - [If](../tB/Modules/Interaction/If) -- evaluates an expression and returns one of two values, with short-circuit evaluation - [IIf](../tB/Modules/Interaction/IIf) -- evaluates an expression and returns one of two values; both branches are always evaluated - [IMEStatus](../tB/Modules/Information/IMEStatus) -- returns the status of the Input Method Editor -- [Input, Input$](../tB/Modules/HiddenModule/Input) -- reads a fixed number of characters from an open sequential file -- [InputB, InputB$](../tB/Modules/HiddenModule/InputB) -- reads a fixed number of bytes from an open sequential file +- [Input, Input$](../tB/Modules/FileSystem/Input) -- reads a fixed number of characters from an open sequential file +- [InputB, InputB$](../tB/Modules/FileSystem/InputB) -- reads a fixed number of bytes from an open sequential file - [InputBox](../tB/Modules/Interaction/InputBox) -- prompts the user for a line of text and returns what was entered - [InStr$, InStrB, InStr](../tB/Modules/Strings/InStr) -- returns the position of one string within another - [InStrRev](../tB/Modules/Strings/InStrRev) -- returns the position of one string within another, searching from the end @@ -186,7 +186,7 @@ permalink: /Reference/Procedures-and-Functions ## O -- [ObjPtr](../tB/Modules/HiddenModule/ObjPtr) -- returns the COM-identity address of an object +- [ObjPtr](../tB/Modules/Information/ObjPtr) -- returns the COM-identity address of an object - [Oct$, Oct](../tB/Modules/Conversion/Oct) -- returns a string representing the octal value of a number ## P @@ -246,7 +246,7 @@ permalink: /Reference/Procedures-and-Functions - [StrComp](../tB/Modules/Strings/StrComp) -- compares two strings - [StrConv](../tB/Modules/Strings/StrConv) -- converts a string to a specified format - [String$, String](../tB/Modules/Strings/String) -- returns a string of repeating characters -- [StrPtr](../tB/Modules/HiddenModule/StrPtr) -- returns the address of the underlying buffer of a **String** +- [StrPtr](../tB/Modules/Information/StrPtr) -- returns the address of the underlying buffer of a **String** - [StrReverse](../tB/Modules/Strings/StrReverse) -- reverses the order of characters in a string - [Switch](../tB/Modules/Interaction/Switch) -- returns the value paired with the first **True** condition in a list of (condition, value) pairs - [SYD](../tB/Modules/Financial/SYD) -- returns the sum-of-years' digits depreciation of an asset for a specified period @@ -272,7 +272,7 @@ permalink: /Reference/Procedures-and-Functions - [Val](../tB/Modules/Conversion/Val) -- parses a string into a **Double** - [ValDec](../tB/Modules/Conversion/ValDec) -- parses a string into a **Decimal** -- [VarPtr](../tB/Modules/HiddenModule/VarPtr) -- returns the address of a variable +- [VarPtr](../tB/Modules/Information/VarPtr) -- returns the address of a variable - [VarType](../tB/Modules/Information/VarType) -- returns the **VbVarType** enumeration value identifying a variable's subtype - [vbaCastObj](../tB/Modules/HiddenModule/vbaCastObj) -- returns an object reinterpreted as another COM interface - [vbaCopyBytes](../tB/Modules/HiddenModule/vbaCopyBytes) -- copies a block of bytes from one address to another @@ -285,7 +285,7 @@ permalink: /Reference/Procedures-and-Functions - [Weekday](../tB/Modules/DateTime/Weekday) -- returns the day of the week from a date value - [WeekdayName](../tB/Modules/Strings/WeekdayName) -- returns the name of the specified day of the week -- [Width](../tB/Modules/HiddenModule/Width) -- sets the line width for a sequential output file +- [Width](../tB/Modules/FileSystem/Width) -- sets the line width for a sequential output file ## X diff --git a/docs/Reference/VBA/Collection/Add.md b/docs/Reference/VBA/Collection/Add.md index d7d44c25..aeb66fb8 100644 --- a/docs/Reference/VBA/Collection/Add.md +++ b/docs/Reference/VBA/Collection/Add.md @@ -1,6 +1,6 @@ --- title: Add -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Add vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Clear.md b/docs/Reference/VBA/Collection/Clear.md index 16f25c0b..e76abf3f 100644 --- a/docs/Reference/VBA/Collection/Clear.md +++ b/docs/Reference/VBA/Collection/Clear.md @@ -1,6 +1,6 @@ --- title: Clear -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Clear vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Count.md b/docs/Reference/VBA/Collection/Count.md index d64e61ec..fb4df2eb 100644 --- a/docs/Reference/VBA/Collection/Count.md +++ b/docs/Reference/VBA/Collection/Count.md @@ -1,6 +1,6 @@ --- title: Count -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Count vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Exists.md b/docs/Reference/VBA/Collection/Exists.md index c727ab36..77411e7b 100644 --- a/docs/Reference/VBA/Collection/Exists.md +++ b/docs/Reference/VBA/Collection/Exists.md @@ -1,6 +1,6 @@ --- title: Exists -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Exists vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Item.md b/docs/Reference/VBA/Collection/Item.md index cd021337..3f2389bd 100644 --- a/docs/Reference/VBA/Collection/Item.md +++ b/docs/Reference/VBA/Collection/Item.md @@ -1,6 +1,6 @@ --- title: Item -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Item vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Items.md b/docs/Reference/VBA/Collection/Items.md index 1da9e982..306c3e24 100644 --- a/docs/Reference/VBA/Collection/Items.md +++ b/docs/Reference/VBA/Collection/Items.md @@ -1,6 +1,6 @@ --- title: Items -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Items vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/KeyCompareMode.md b/docs/Reference/VBA/Collection/KeyCompareMode.md index f3ab6559..ffbe79f3 100644 --- a/docs/Reference/VBA/Collection/KeyCompareMode.md +++ b/docs/Reference/VBA/Collection/KeyCompareMode.md @@ -1,6 +1,6 @@ --- title: KeyCompareMode -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/KeyCompareMode vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/KeyCountHint.md b/docs/Reference/VBA/Collection/KeyCountHint.md index 67124b5d..f973555d 100644 --- a/docs/Reference/VBA/Collection/KeyCountHint.md +++ b/docs/Reference/VBA/Collection/KeyCountHint.md @@ -1,6 +1,6 @@ --- title: KeyCountHint -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/KeyCountHint vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Keys.md b/docs/Reference/VBA/Collection/Keys.md index 751344b9..10cca788 100644 --- a/docs/Reference/VBA/Collection/Keys.md +++ b/docs/Reference/VBA/Collection/Keys.md @@ -1,6 +1,6 @@ --- title: Keys -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Keys vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/Remove.md b/docs/Reference/VBA/Collection/Remove.md index 04480a31..8051be79 100644 --- a/docs/Reference/VBA/Collection/Remove.md +++ b/docs/Reference/VBA/Collection/Remove.md @@ -1,6 +1,6 @@ --- title: Remove -parent: Collection Module +parent: Collection permalink: /tB/Modules/Collection/Remove vba_attribution: true --- diff --git a/docs/Reference/VBA/Collection/index.md b/docs/Reference/VBA/Collection/index.md index 7f8379cf..bf289f4f 100644 --- a/docs/Reference/VBA/Collection/index.md +++ b/docs/Reference/VBA/Collection/index.md @@ -1,11 +1,12 @@ --- -title: Collection Module +title: Collection parent: VBA Package +nav_order: 10 permalink: /tB/Modules/Collection/ has_toc: false --- -# Collection module +# Collection class A **Collection** is an ordered set of items that can be referred to as a unit. The members of a collection do not have to share a data type — any value or object reference is acceptable. Items are accessed by their one-based numeric position in the collection or, if they were added with a key, by that key. diff --git a/docs/Reference/VBA/ErrObject/Clear.md b/docs/Reference/VBA/ErrObject/Clear.md index 583baa6b..7b00142f 100644 --- a/docs/Reference/VBA/ErrObject/Clear.md +++ b/docs/Reference/VBA/ErrObject/Clear.md @@ -1,6 +1,6 @@ --- title: Clear -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/Clear vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/Description.md b/docs/Reference/VBA/ErrObject/Description.md index c0cd86ec..4db8e0bc 100644 --- a/docs/Reference/VBA/ErrObject/Description.md +++ b/docs/Reference/VBA/ErrObject/Description.md @@ -1,6 +1,6 @@ --- title: Description -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/Description vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/HelpContext.md b/docs/Reference/VBA/ErrObject/HelpContext.md index ca9b68ac..d2589096 100644 --- a/docs/Reference/VBA/ErrObject/HelpContext.md +++ b/docs/Reference/VBA/ErrObject/HelpContext.md @@ -1,6 +1,6 @@ --- title: HelpContext -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/HelpContext vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/HelpFile.md b/docs/Reference/VBA/ErrObject/HelpFile.md index 104d6e19..9f908a39 100644 --- a/docs/Reference/VBA/ErrObject/HelpFile.md +++ b/docs/Reference/VBA/ErrObject/HelpFile.md @@ -1,6 +1,6 @@ --- title: HelpFile -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/HelpFile vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/LastDllError.md b/docs/Reference/VBA/ErrObject/LastDllError.md index 7a59ab3d..5ec575cc 100644 --- a/docs/Reference/VBA/ErrObject/LastDllError.md +++ b/docs/Reference/VBA/ErrObject/LastDllError.md @@ -1,6 +1,6 @@ --- title: LastDllError -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/LastDllError vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/LastHresult.md b/docs/Reference/VBA/ErrObject/LastHresult.md index afe32a7c..1566dee7 100644 --- a/docs/Reference/VBA/ErrObject/LastHresult.md +++ b/docs/Reference/VBA/ErrObject/LastHresult.md @@ -1,6 +1,6 @@ --- title: LastHresult -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/LastHresult --- # LastHresult diff --git a/docs/Reference/VBA/ErrObject/Number.md b/docs/Reference/VBA/ErrObject/Number.md index 23a1c3ac..9962fec3 100644 --- a/docs/Reference/VBA/ErrObject/Number.md +++ b/docs/Reference/VBA/ErrObject/Number.md @@ -1,6 +1,6 @@ --- title: Number -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/Number vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/Raise.md b/docs/Reference/VBA/ErrObject/Raise.md index 27423c3a..3c3ee976 100644 --- a/docs/Reference/VBA/ErrObject/Raise.md +++ b/docs/Reference/VBA/ErrObject/Raise.md @@ -1,6 +1,6 @@ --- title: Raise -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/Raise vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/ReturnHResult.md b/docs/Reference/VBA/ErrObject/ReturnHResult.md index 7bd09eab..279692fb 100644 --- a/docs/Reference/VBA/ErrObject/ReturnHResult.md +++ b/docs/Reference/VBA/ErrObject/ReturnHResult.md @@ -1,6 +1,6 @@ --- title: ReturnHResult -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/ReturnHResult --- # ReturnHResult diff --git a/docs/Reference/VBA/ErrObject/Source.md b/docs/Reference/VBA/ErrObject/Source.md index 3777dfd4..d9498e8e 100644 --- a/docs/Reference/VBA/ErrObject/Source.md +++ b/docs/Reference/VBA/ErrObject/Source.md @@ -1,6 +1,6 @@ --- title: Source -parent: ErrObject Module +parent: ErrObject permalink: /tB/Modules/ErrObject/Source vba_attribution: true --- diff --git a/docs/Reference/VBA/ErrObject/index.md b/docs/Reference/VBA/ErrObject/index.md index fc14a68b..97f14846 100644 --- a/docs/Reference/VBA/ErrObject/index.md +++ b/docs/Reference/VBA/ErrObject/index.md @@ -1,11 +1,12 @@ --- -title: ErrObject Module +title: ErrObject parent: VBA Package +nav_order: 11 permalink: /tB/Modules/ErrObject/ has_toc: false --- -# ErrObject module +# ErrObject class The **Err** object holds information about the most recent run-time error. It is a global, intrinsic singleton — there is no need to declare it or construct one with **New**, just reference it as **Err**. The default property is [**Number**](Number), so a bare **Err** is equivalent to `Err.Number`. diff --git a/docs/Reference/VBA/HiddenModule/Input.md b/docs/Reference/VBA/FileSystem/Input.md similarity index 79% rename from docs/Reference/VBA/HiddenModule/Input.md rename to docs/Reference/VBA/FileSystem/Input.md index 31036351..d2cfedbe 100644 --- a/docs/Reference/VBA/HiddenModule/Input.md +++ b/docs/Reference/VBA/FileSystem/Input.md @@ -1,7 +1,9 @@ --- title: Input, Input$ -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/Input +parent: FileSystem Module +permalink: /tB/Modules/FileSystem/Input +redirect_from: + - /tB/Modules/HiddenModule/Input vba_attribution: true --- # Input, Input$ @@ -23,7 +25,7 @@ Data read with **Input** is usually written to a file with **Print #** or **[Put Unlike the **Input #** statement, the **Input** function returns all the characters it reads, including commas, carriage returns, linefeeds, quotation marks, and leading spaces. -For files opened for **Binary** access, an attempt to read through the file using **Input** until [**EOF**](../FileSystem/EOF) returns **True** generates an error. Use [**LOF**](../FileSystem/LOF) and [**Loc**](../FileSystem/Loc) instead of **EOF** when reading binary files with **Input**, or use **[Get](../../Core/Get)** when **EOF** is needed. +For files opened for **Binary** access, an attempt to read through the file using **Input** until [**EOF**](EOF) returns **True** generates an error. Use [**LOF**](LOF) and [**Loc**](Loc) instead of **EOF** when reading binary files with **Input**, or use **[Get](../../Core/Get)** when **EOF** is needed. > [!NOTE] > Use [**InputB**](InputB) for byte data contained within text files. With **InputB**, *Number* specifies the number of bytes to return rather than the number of characters. @@ -46,4 +48,4 @@ Close #1 ' Close file. - [InputB, InputB$](InputB) functions - [Open](../../Core/Open) statement -- [EOF](../FileSystem/EOF), [LOF](../FileSystem/LOF), [Loc](../FileSystem/Loc) functions +- [EOF](EOF), [LOF](LOF), [Loc](Loc) functions diff --git a/docs/Reference/VBA/HiddenModule/InputB.md b/docs/Reference/VBA/FileSystem/InputB.md similarity index 90% rename from docs/Reference/VBA/HiddenModule/InputB.md rename to docs/Reference/VBA/FileSystem/InputB.md index 5ba5d264..0502fe27 100644 --- a/docs/Reference/VBA/HiddenModule/InputB.md +++ b/docs/Reference/VBA/FileSystem/InputB.md @@ -1,7 +1,9 @@ --- title: InputB, InputB$ -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/InputB +parent: FileSystem Module +permalink: /tB/Modules/FileSystem/InputB +redirect_from: + - /tB/Modules/HiddenModule/InputB vba_attribution: true --- # InputB, InputB$ @@ -36,4 +38,4 @@ Close #1 - [Input, Input$](Input) functions - [Open](../../Core/Open) statement -- [LOF](../FileSystem/LOF) function +- [LOF](LOF) function diff --git a/docs/Reference/VBA/HiddenModule/Width.md b/docs/Reference/VBA/FileSystem/Width.md similarity index 90% rename from docs/Reference/VBA/HiddenModule/Width.md rename to docs/Reference/VBA/FileSystem/Width.md index ad44a397..1bc95c2a 100644 --- a/docs/Reference/VBA/HiddenModule/Width.md +++ b/docs/Reference/VBA/FileSystem/Width.md @@ -1,9 +1,10 @@ --- title: Width -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/Width +parent: FileSystem Module +permalink: /tB/Modules/FileSystem/Width redirect_from: -- /tB/Core/Width + - /tB/Core/Width + - /tB/Modules/HiddenModule/Width vba_attribution: true --- # Width # diff --git a/docs/Reference/VBA/FileSystem/index.md b/docs/Reference/VBA/FileSystem/index.md index 71f1c031..4879e989 100644 --- a/docs/Reference/VBA/FileSystem/index.md +++ b/docs/Reference/VBA/FileSystem/index.md @@ -7,7 +7,7 @@ has_toc: false # FileSystem module -The **FileSystem** module groups together the procedures and statements for working with files and directories on disk. Its members divide cleanly into two camps: *pathname-based* operations that act on something named in the filesystem, and *file-number-based* operations that act on a handle previously returned by the **Open** statement. +The **FileSystem** module groups together the procedures and statements for working with files and directories on disk. Its members divide cleanly into two camps: *pathname-based* operations that act on something named in the filesystem (creating and deleting files and directories, querying their attributes, walking a directory listing), and *file-number-based* operations that act on a handle previously returned by the **Open** statement (reading, positioning, formatting, and tracking the channel). ## Navigating directories @@ -68,6 +68,12 @@ Loop Close #N ``` +## Reading and formatting through open file numbers + +[**Input**](Input) and [**Input$**](Input) return a fixed number of characters read from a file number opened with **Open**, as a **Variant** or a **String** respectively; [**InputB**](InputB) and [**InputB$**](InputB) are their byte-oriented counterparts, counting raw bytes rather than UTF-16 characters. They differ from the **Input #** statement in that they return every character they read — commas, newlines, quotation marks, leading spaces, and all — making them the right choice when the bytes on disk are not a stream of comma-delimited values. + +[**Width**](Width) sets the output line width on a sequential output channel: subsequent **Print #** wraps to a new line once the chosen number of characters has been written, or never wraps at all when *Width* is `0`. + ## Members - [ChDir](ChDir) -- changes the current directory or folder @@ -81,6 +87,8 @@ Close #N - [FileLen](FileLen) -- returns the length of a file in bytes - [FreeFile](FreeFile) -- returns the next file number available for use by the **Open** statement - [GetAttr](GetAttr) -- returns the attributes of a file or directory +- [Input, Input$](Input) -- reads a fixed number of characters from an open sequential file +- [InputB, InputB$](InputB) -- reads a fixed number of bytes from an open sequential file - [Kill](Kill) -- deletes files from a disk - [Loc](Loc) -- returns the current read/write position within an open file - [LOF](LOF) -- returns the size, in bytes, of an open file @@ -89,3 +97,4 @@ Close #N - [RmDir](RmDir) -- removes an existing directory or folder - [Seek](Seek) -- returns or sets the read/write position within an open file - [SetAttr](SetAttr) -- sets attribute information for a file +- [Width](Width) -- sets the line width for a sequential output file diff --git a/docs/Reference/VBA/HiddenModule/Eval.md b/docs/Reference/VBA/HiddenModule/Eval.md index bc4db82f..6feb483a 100644 --- a/docs/Reference/VBA/HiddenModule/Eval.md +++ b/docs/Reference/VBA/HiddenModule/Eval.md @@ -13,9 +13,9 @@ Syntax: **Eval(** *Expression* **)** **As Variant** *Expression* : *required* **String**. A twinBASIC expression that resolves to a value — for example, `"2 + 2"`, `"Sqr(2)"`, or `"UCase(""hello"")"`. -A fresh [**TbExpressionService**](../ExpressionService/) is built for every call, with the standard library binder registered so the standard runtime functions ([**Sin**](../Math/Sin), [**Sqr**](../Math/Sqr), [**Len**](../Strings/Len), [**CStr**](../Conversion/CStr), and the rest) are visible. The expression is then compiled and evaluated once, and the service is discarded. +A fresh [**TbExpressionService**](../TbExpressionService/) is built for every call, with the standard library binder registered so the standard runtime functions ([**Sin**](../Math/Sin), [**Sqr**](../Math/Sqr), [**Len**](../Strings/Len), [**CStr**](../Conversion/CStr), and the rest) are visible. The expression is then compiled and evaluated once, and the service is discarded. -For repeated evaluation of the same source, or for expressions that need to see your own application objects, build the service yourself and reuse a compiled [**ITbExpression**](../ExpressionService/#itbexpression-interface) — see the [ExpressionService module](../ExpressionService/) for details. +For repeated evaluation of the same source, or for expressions that need to see your own application objects, build the service yourself and reuse a compiled [**ITbExpression**](../TbExpressionService/#itbexpression-interface). ### Example diff --git a/docs/Reference/VBA/HiddenModule/index.md b/docs/Reference/VBA/HiddenModule/index.md index 317259a1..7bed5891 100644 --- a/docs/Reference/VBA/HiddenModule/index.md +++ b/docs/Reference/VBA/HiddenModule/index.md @@ -9,15 +9,15 @@ has_toc: false # (Default) module -The **(Default)** module — known internally as **\_HiddenModule** — gathers together the unqualified intrinsic procedures: pointer- and memory-level helpers, the file-input pseudo-functions, the bridges into the codegen and reflection machinery, and a long tail of runtime utilities that the compiler emits calls into but that are also callable directly. Members of this module are referenced without a qualifier, the same way **MsgBox** and **CStr** are. +The **(Default)** module — known internally as **\_HiddenModule** — gathers together the unqualified intrinsic procedures that the compiler emits calls into and that are also callable directly: raw-memory helpers, atomic operations, compile-time reflection, codegen and stack-inspection primitives, and a long tail of runtime utilities. Members of this module are referenced without a qualifier, the same way **MsgBox** and **CStr** are. Most of these procedures are deliberately hidden from IntelliSense and exist for advanced or low-level use; reach for them only when the higher-level alternatives in **[Math](../Math/)**, **[Strings](../Strings/)**, **[Information](../Information/)**, or **[Interaction](../Interaction/)** don't cover the case. Several have additional internal-only members that are not listed here at all. -## Pointers and memory +The pointer functions [**ObjPtr**](../Information/ObjPtr), [**StrPtr**](../Information/StrPtr), and [**VarPtr**](../Information/VarPtr) and the [**Array**](../Information/Array) constructor are documented under the [**Information**](../Information/) module; [**Input**](../FileSystem/Input), [**InputB**](../FileSystem/InputB), and [**Width**](../FileSystem/Width) under [**FileSystem**](../FileSystem/). -Three functions return raw addresses for use with API calls or unsafe interop: [**ObjPtr**](ObjPtr) for an object's COM identity, [**StrPtr**](StrPtr) for the underlying buffer of a **String**, and [**VarPtr**](VarPtr) for any variable. +## Reading and writing memory -Memory at a known address is read and written one machine word at a time with the **GetMem*** / **PutMem*** family — [**GetMem1**](GetMem1), [**GetMem2**](GetMem2), [**GetMem4**](GetMem4), [**GetMem8**](GetMem8), and [**GetMemPtr**](GetMemPtr) for reads, with matching [**PutMem1**](PutMem1), [**PutMem2**](PutMem2), [**PutMem4**](PutMem4), [**PutMem8**](PutMem8), and [**PutMemPtr**](PutMemPtr). [**vbaCopyBytes**](vbaCopyBytes) and [**vbaCopyBytesZero**](vbaCopyBytesZero) move blocks; [**AllocMem**](AllocMem) and [**FreeMem**](FreeMem) manage heap allocations. +Memory at a known address is read and written one machine word at a time with the **GetMem*** / **PutMem*** family — [**GetMem1**](GetMem1), [**GetMem2**](GetMem2), [**GetMem4**](GetMem4), [**GetMem8**](GetMem8), and [**GetMemPtr**](GetMemPtr) for reads, with matching [**PutMem1**](PutMem1), [**PutMem2**](PutMem2), [**PutMem4**](PutMem4), [**PutMem8**](PutMem8), and [**PutMemPtr**](PutMemPtr). [**vbaCopyBytes**](vbaCopyBytes) and [**vbaCopyBytesZero**](vbaCopyBytesZero) move blocks; [**AllocMem**](AllocMem) and [**FreeMem**](FreeMem) manage heap allocations. The pointer constructors that feed these helpers — [**ObjPtr**](../Information/ObjPtr), [**StrPtr**](../Information/StrPtr), [**VarPtr**](../Information/VarPtr) — live in [**Information**](../Information/). ```tb Dim Buffer As LongPtr = AllocMem(16) @@ -27,20 +27,6 @@ GetMem4 Buffer, Magic FreeMem Buffer ``` -## Reading from open files - -[**Input**](Input) and [**Input$**](Input) read a fixed number of characters from a file opened with **Open**, returning a **Variant** or a **String** respectively. [**InputB**](InputB) and [**InputB$**](InputB) are their byte-oriented counterparts. [**Width**](Width) sets the line width on a sequential output channel. - -## Building variant arrays - -[**Array**](Array) creates a **Variant** array from a comma-separated list of values; the lower bound follows the source file's **Option Base** setting. As a special form, the same name doubles as a destructuring `Property Let` for unpacking an array on the right-hand side into individual variables on the left. - -```tb -Dim a As Variant = Array("one", "two", "three") -Dim x As Variant, y As Variant, z As Variant -Array(x, y, z) = a ' destructuring assignment -``` - [**vbaRefVarAry**](vbaRefVarAry) and [**vbaAryMove**](vbaAryMove) are lower-level helpers used when interfacing with C-side array layouts. ## Object references and casting @@ -74,7 +60,6 @@ A handful of intrinsics ask questions about the surrounding type without running ## Members - [AllocMem](AllocMem) -- allocates a block of native memory and returns its address -- [Array](Array) -- creates a **Variant** array from a comma-separated list of values, or destructures one when used on the left of an assignment - [ConvertIconToBitmap](ConvertIconToBitmap) -- converts an icon picture to a bitmap picture - [CreateGUID](CreateGUID) -- generates a fresh GUID and returns it as a registry-formatted string - [CreateStdPictureFromHandle](CreateStdPictureFromHandle) -- wraps a GDI bitmap or icon handle in an **stdole.StdPicture** @@ -95,15 +80,12 @@ A handful of intrinsics ask questions about the surrounding type without running - [GetMem8](GetMem8) -- reads eight bytes from a memory address into a **Currency** variable - [GetMemPtr](GetMemPtr) -- reads a pointer-sized value from a memory address into a **LongPtr** variable - [GetShortcutTextByEnum](GetShortcutTextByEnum) -- returns the localized text for a built-in keyboard shortcut by its enumeration ID -- [Input, Input$](Input) -- reads a fixed number of characters from an open sequential file -- [InputB, InputB$](InputB) -- reads a fixed number of bytes from an open sequential file - [InterlockedCompareExchange32](InterlockedCompareExchange32) -- atomically compares and exchanges a 32-bit value - [InterlockedCompareExchange64](InterlockedCompareExchange64) -- atomically compares and exchanges a 64-bit value - [InterlockedCompareExchangePointer](InterlockedCompareExchangePointer) -- atomically compares and exchanges a pointer-sized value - [InterlockedDecrement32](InterlockedDecrement32) -- atomically decrements a 32-bit value and returns the new value - [InterlockedExchangePointer](InterlockedExchangePointer) -- atomically exchanges a pointer-sized value and returns the previous value - [InterlockedIncrement32](InterlockedIncrement32) -- atomically increments a 32-bit value and returns the new value -- [ObjPtr](ObjPtr) -- returns the COM-identity address of an object - [PictureToByteArray](PictureToByteArray) -- serialises an **IPicture** into a **Byte** array - [PutMem1](PutMem1) -- writes one byte to a memory address - [PutMem2](PutMem2) -- writes two bytes to a memory address @@ -114,10 +96,7 @@ A handful of intrinsics ask questions about the surrounding type without running - [SetThreadGlobalErrorTrap](SetThreadGlobalErrorTrap) -- registers a global callback invoked when an unhandled error is raised on the calling thread - [StackArgsSize](StackArgsSize) -- returns the total size, in bytes, of the arguments on the current procedure's stack frame - [StackOffset](StackOffset) -- returns the stack-frame offset of a variable -- [StrPtr](StrPtr) -- returns the address of the underlying buffer of a **String** - [UnprotectedAccess](UnprotectedAccess) -- returns an object reference that bypasses access checks on private members -- [VarPtr](VarPtr) -- returns the address of a variable -- [Width](Width) -- sets the line width for a sequential output file - [vbaAryMove](vbaAryMove) -- moves the contents of one array variable into another - [vbaCastObj](vbaCastObj) -- returns an object reinterpreted as another COM interface - [vbaCopyBytes](vbaCopyBytes) -- copies a block of bytes from one address to another diff --git a/docs/Reference/VBA/HiddenModule/Array.md b/docs/Reference/VBA/Information/Array.md similarity index 93% rename from docs/Reference/VBA/HiddenModule/Array.md rename to docs/Reference/VBA/Information/Array.md index 223ff160..6d683541 100644 --- a/docs/Reference/VBA/HiddenModule/Array.md +++ b/docs/Reference/VBA/Information/Array.md @@ -1,9 +1,10 @@ --- title: Array -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/Array +parent: Information Module +permalink: /tB/Modules/Information/Array redirect_from: - /tB/Core/Array + - /tB/Modules/HiddenModule/Array vba_attribution: true --- # Array @@ -63,4 +64,4 @@ MyDay = MyWeek(2) ' MyDay contains "Wed" with default Option Base 0, ### See Also - [Option](../../Core/Option) statement -- [LBound](../Information/LBound), [UBound](../Information/UBound) functions +- [LBound](LBound), [UBound](UBound) functions diff --git a/docs/Reference/VBA/HiddenModule/ObjPtr.md b/docs/Reference/VBA/Information/ObjPtr.md similarity index 90% rename from docs/Reference/VBA/HiddenModule/ObjPtr.md rename to docs/Reference/VBA/Information/ObjPtr.md index b70dcfee..cd55beb1 100644 --- a/docs/Reference/VBA/HiddenModule/ObjPtr.md +++ b/docs/Reference/VBA/Information/ObjPtr.md @@ -1,7 +1,9 @@ --- title: ObjPtr -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/ObjPtr +parent: Information Module +permalink: /tB/Modules/Information/ObjPtr +redirect_from: + - /tB/Modules/HiddenModule/ObjPtr --- # ObjPtr {: .no_toc } diff --git a/docs/Reference/VBA/HiddenModule/StrPtr.md b/docs/Reference/VBA/Information/StrPtr.md similarity index 90% rename from docs/Reference/VBA/HiddenModule/StrPtr.md rename to docs/Reference/VBA/Information/StrPtr.md index 70d46121..9b4925b3 100644 --- a/docs/Reference/VBA/HiddenModule/StrPtr.md +++ b/docs/Reference/VBA/Information/StrPtr.md @@ -1,7 +1,9 @@ --- title: StrPtr -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/StrPtr +parent: Information Module +permalink: /tB/Modules/Information/StrPtr +redirect_from: + - /tB/Modules/HiddenModule/StrPtr --- # StrPtr {: .no_toc } diff --git a/docs/Reference/VBA/HiddenModule/VarPtr.md b/docs/Reference/VBA/Information/VarPtr.md similarity index 90% rename from docs/Reference/VBA/HiddenModule/VarPtr.md rename to docs/Reference/VBA/Information/VarPtr.md index a42f6a6a..3257a81d 100644 --- a/docs/Reference/VBA/HiddenModule/VarPtr.md +++ b/docs/Reference/VBA/Information/VarPtr.md @@ -1,7 +1,9 @@ --- title: VarPtr -parent: (Default) Module -permalink: /tB/Modules/HiddenModule/VarPtr +parent: Information Module +permalink: /tB/Modules/Information/VarPtr +redirect_from: + - /tB/Modules/HiddenModule/VarPtr --- # VarPtr {: .no_toc } diff --git a/docs/Reference/VBA/Information/index.md b/docs/Reference/VBA/Information/index.md index 954f982c..9fb4c475 100644 --- a/docs/Reference/VBA/Information/index.md +++ b/docs/Reference/VBA/Information/index.md @@ -7,7 +7,7 @@ has_toc: false # Information module -The **Information** module groups together standalone procedures for asking questions about a value at run time — its subtype, whether it has been initialised, whether an optional argument was supplied — together with related utilities for querying array bounds, building and decomposing colour values, and reaching the current run-time error state. +The **Information** module groups together standalone procedures for asking questions about a value at run time — its subtype, whether it has been initialised, whether an optional argument was supplied — together with related utilities for querying array bounds, building **Variant** arrays, taking raw addresses, decomposing colour values, and reaching the current run-time error state. ## Inspecting a value @@ -33,6 +33,27 @@ Debug.Print LBound(Grid, 2) ' 0 — second dimension lower bound Debug.Print UBound(Grid, 2) ' 9 — second dimension upper bound ``` +## Building Variant arrays + +[**Array**](Array) creates a **Variant** array from a comma-separated list of values; the lower bound follows the source file's **Option Base** setting. As a special form, the same name doubles as a destructuring `Property Let` for unpacking an array on the right-hand side into individual variables on the left. + +```tb +Dim a As Variant = Array("one", "two", "three") +Dim x As Variant, y As Variant, z As Variant +Array(x, y, z) = a ' destructuring assignment +``` + +## Raw pointers + +Three functions return raw addresses for use with API calls or unsafe interop: [**ObjPtr**](ObjPtr) for an object's COM identity, [**StrPtr**](StrPtr) for the underlying buffer of a **String**, and [**VarPtr**](VarPtr) for any variable. The result is a **LongPtr** valid only while the underlying object, string, or variable stays alive — taking a pointer never holds a reference of its own. To read or write the memory at a known address, pair these with the [**GetMem**](../HiddenModule/GetMem4) / [**PutMem**](../HiddenModule/PutMem4) family from the [(Default)](../HiddenModule/) module. + +```tb +Dim n As Long = &H12345678 +Dim Bytes(0 To 3) As Byte +vbaCopyBytes 4, VarPtr(Bytes(0)), VarPtr(n) +Debug.Print Hex(Bytes(0)) ' "78" — little-endian +``` + ## Working with colour values [**RGB**](RGB) and [**RGBA**](RGBA) build a 32-bit colour value from individual red, green, blue, and (optionally) alpha components; [**RGB_R**](RGB_R), [**RGB_G**](RGB_G), [**RGB_B**](RGB_B), and [**RGBA_A**](RGBA_A) extract those components back out. [**QBColor**](QBColor) returns the RGB value of one of the sixteen QuickBASIC colour indexes, and [**TranslateColor**](TranslateColor) converts an OLE colour value (which may reference an entry in the system palette) into a plain RGB colour. @@ -51,6 +72,7 @@ Debug.Print RGB_B(C) ' 150 ## Members +- [Array](Array) -- creates a **Variant** array from a comma-separated list of values, or destructures one when used on the left of an assignment - [Erl](Erl) -- returns the line number where the most recent run-time error occurred - [Err](Err) -- returns the [**ErrObject**](../ErrObject) describing the current run-time error state - [IMEStatus](IMEStatus) -- returns the status of the Input Method Editor @@ -64,6 +86,7 @@ Debug.Print RGB_B(C) ' 150 - [IsNumeric](IsNumeric) -- returns whether an expression can be evaluated as a number - [IsObject](IsObject) -- returns whether a variable refers to an object - [LBound](LBound) -- returns the smallest valid subscript for a dimension of an array +- [ObjPtr](ObjPtr) -- returns the COM-identity address of an object - [QBColor](QBColor) -- returns the RGB colour value for a QuickBASIC colour index - [RGB](RGB) -- builds an RGB colour value from red, green, and blue components - [RGBA](RGBA) -- builds an RGBA colour value from red, green, blue, and alpha components @@ -71,7 +94,9 @@ Debug.Print RGB_B(C) ' 150 - [RGB_B](RGB_B) -- returns the blue component of an RGB colour value - [RGB_G](RGB_G) -- returns the green component of an RGB colour value - [RGB_R](RGB_R) -- returns the red component of an RGB colour value +- [StrPtr](StrPtr) -- returns the address of the underlying buffer of a **String** - [TranslateColor](TranslateColor) -- translates an OLE colour value to a plain RGB colour value - [TypeName](TypeName) -- returns the name of a variable's data type as a **String** - [UBound](UBound) -- returns the largest valid subscript for a dimension of an array +- [VarPtr](VarPtr) -- returns the address of a variable - [VarType](VarType) -- returns the [**VbVarType**](../Constants/VbVarType) enumeration value identifying a variable's subtype diff --git a/docs/Reference/VBA/ExpressionService/AddCustomBinder.md b/docs/Reference/VBA/TbExpressionService/AddCustomBinder.md similarity index 92% rename from docs/Reference/VBA/ExpressionService/AddCustomBinder.md rename to docs/Reference/VBA/TbExpressionService/AddCustomBinder.md index ead7a294..97c60e0d 100644 --- a/docs/Reference/VBA/ExpressionService/AddCustomBinder.md +++ b/docs/Reference/VBA/TbExpressionService/AddCustomBinder.md @@ -1,7 +1,9 @@ --- title: AddCustomBinder -parent: ExpressionService Module -permalink: /tB/Modules/ExpressionService/AddCustomBinder +parent: TbExpressionService +permalink: /tB/Modules/TbExpressionService/AddCustomBinder +redirect_from: + - /tB/Modules/ExpressionService/AddCustomBinder --- # AddCustomBinder {: .no_toc } diff --git a/docs/Reference/VBA/ExpressionService/AddCustomBinderObject.md b/docs/Reference/VBA/TbExpressionService/AddCustomBinderObject.md similarity index 92% rename from docs/Reference/VBA/ExpressionService/AddCustomBinderObject.md rename to docs/Reference/VBA/TbExpressionService/AddCustomBinderObject.md index b5e88de2..fe117da8 100644 --- a/docs/Reference/VBA/ExpressionService/AddCustomBinderObject.md +++ b/docs/Reference/VBA/TbExpressionService/AddCustomBinderObject.md @@ -1,7 +1,9 @@ --- title: AddCustomBinderObject -parent: ExpressionService Module -permalink: /tB/Modules/ExpressionService/AddCustomBinderObject +parent: TbExpressionService +permalink: /tB/Modules/TbExpressionService/AddCustomBinderObject +redirect_from: + - /tB/Modules/ExpressionService/AddCustomBinderObject --- # AddCustomBinderObject {: .no_toc } diff --git a/docs/Reference/VBA/ExpressionService/AddStdLibraryBinder.md b/docs/Reference/VBA/TbExpressionService/AddStdLibraryBinder.md similarity index 89% rename from docs/Reference/VBA/ExpressionService/AddStdLibraryBinder.md rename to docs/Reference/VBA/TbExpressionService/AddStdLibraryBinder.md index 0d1696ce..e87c20a3 100644 --- a/docs/Reference/VBA/ExpressionService/AddStdLibraryBinder.md +++ b/docs/Reference/VBA/TbExpressionService/AddStdLibraryBinder.md @@ -1,7 +1,9 @@ --- title: AddStdLibraryBinder -parent: ExpressionService Module -permalink: /tB/Modules/ExpressionService/AddStdLibraryBinder +parent: TbExpressionService +permalink: /tB/Modules/TbExpressionService/AddStdLibraryBinder +redirect_from: + - /tB/Modules/ExpressionService/AddStdLibraryBinder --- # AddStdLibraryBinder {: .no_toc } diff --git a/docs/Reference/VBA/ExpressionService/Bind.md b/docs/Reference/VBA/TbExpressionService/Bind.md similarity index 94% rename from docs/Reference/VBA/ExpressionService/Bind.md rename to docs/Reference/VBA/TbExpressionService/Bind.md index 23b4a65f..f4ec6239 100644 --- a/docs/Reference/VBA/ExpressionService/Bind.md +++ b/docs/Reference/VBA/TbExpressionService/Bind.md @@ -1,7 +1,9 @@ --- title: Bind -parent: ExpressionService Module -permalink: /tB/Modules/ExpressionService/Bind +parent: TbExpressionService Module +permalink: /tB/Modules/TbExpressionService/Bind +redirect_from: + - /tB/Modules/ExpressionService/Bind --- # Bind {: .no_toc } diff --git a/docs/Reference/VBA/ExpressionService/Compile.md b/docs/Reference/VBA/TbExpressionService/Compile.md similarity index 93% rename from docs/Reference/VBA/ExpressionService/Compile.md rename to docs/Reference/VBA/TbExpressionService/Compile.md index 6d7f1024..26375ae4 100644 --- a/docs/Reference/VBA/ExpressionService/Compile.md +++ b/docs/Reference/VBA/TbExpressionService/Compile.md @@ -1,7 +1,9 @@ --- title: Compile -parent: ExpressionService Module -permalink: /tB/Modules/ExpressionService/Compile +parent: TbExpressionService +permalink: /tB/Modules/TbExpressionService/Compile +redirect_from: + - /tB/Modules/ExpressionService/Compile --- # Compile {: .no_toc } diff --git a/docs/Reference/VBA/ExpressionService/Evaluate.md b/docs/Reference/VBA/TbExpressionService/Evaluate.md similarity index 92% rename from docs/Reference/VBA/ExpressionService/Evaluate.md rename to docs/Reference/VBA/TbExpressionService/Evaluate.md index 51340217..a7500c41 100644 --- a/docs/Reference/VBA/ExpressionService/Evaluate.md +++ b/docs/Reference/VBA/TbExpressionService/Evaluate.md @@ -1,7 +1,9 @@ --- title: Evaluate -parent: ExpressionService Module -permalink: /tB/Modules/ExpressionService/Evaluate +parent: TbExpressionService +permalink: /tB/Modules/TbExpressionService/Evaluate +redirect_from: + - /tB/Modules/ExpressionService/Evaluate --- # Evaluate {: .no_toc } diff --git a/docs/Reference/VBA/ExpressionService/index.md b/docs/Reference/VBA/TbExpressionService/index.md similarity index 88% rename from docs/Reference/VBA/ExpressionService/index.md rename to docs/Reference/VBA/TbExpressionService/index.md index 3b7f676f..5042475c 100644 --- a/docs/Reference/VBA/ExpressionService/index.md +++ b/docs/Reference/VBA/TbExpressionService/index.md @@ -1,15 +1,18 @@ --- -title: ExpressionService Module +title: TbExpressionService parent: VBA Package -permalink: /tB/Modules/ExpressionService/ +nav_order: 12 +permalink: /tB/Modules/TbExpressionService/ +redirect_from: + - /tB/Modules/ExpressionService/ has_toc: false --- -# ExpressionService module +# TbExpressionService class -The **ExpressionService** module provides a runtime expression engine: a way to take twinBASIC-syntax expressions supplied as ordinary strings and compile and evaluate them on the fly, without going through a separate build step. It powers calculators, formula columns in reports, scriptable property bindings, and any other feature that needs to turn user-supplied text into a value. +**TbExpressionService** is twinBASIC's runtime expression engine: a way to take twinBASIC-syntax expressions supplied as ordinary strings and compile and evaluate them on the fly, without going through a separate build step. It powers calculators, formula columns in reports, scriptable property bindings, and any other feature that needs to turn user-supplied text into a value. -The module exposes one class and two interfaces: +It is exposed as one class and two interfaces: - [**TbExpressionService**](#tbexpressionservice-class) — the engine; instantiate one with **New**, register its binders, then [**Compile**](Compile) expressions against it. - [**ITbExpression**](#itbexpression-interface) — a compiled expression handle returned by [**Compile**](Compile), evaluated with [**Evaluate**](Evaluate). diff --git a/docs/Reference/VBA/TextEncodingConstants/index.md b/docs/Reference/VBA/TextEncodingConstants/index.md deleted file mode 100644 index f59254f7..00000000 --- a/docs/Reference/VBA/TextEncodingConstants/index.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: TextEncodingConstants Module -parent: VBA Package -permalink: /tB/Modules/TextEncodingConstants/ -has_toc: false ---- - -# TextEncodingConstants module - -The `Open` statement supports Unicode through the use of a new `Encoding` keyword and variable, and allows you to specify a wide range of encoding options in addition to standard Unicode options. - -The **TextEncodingConstants** module provides the predefined identifier strings recognised by the **Encoding** clause of the **Open** statement: - -```tb -Open "C:\MyFile.txt" For Input Encoding utf_8 As #1 -``` - -The constants below name the well-known encodings; other system-supported encodings with similar identifier strings are also accepted at runtime. - -The members are marked **[Hidden, Restricted]** — they are omitted from general IntelliSense, but the IDE surfaces them specifically after the **Encoding** keyword. - -## Default and Unicode - -| Constant | Value | Description | -|----------|-------|-------------| -| **default_system_ansi**{: #default_system_ansi } | `"default"` | The system default ANSI code page. | -| **utf_7**{: #utf_7 } | `"utf-7"` | UTF-7. | -| **utf_7_bom**{: #utf_7_bom } | `"utf-7 bom"` | UTF-7 with byte-order mark. | -| **utf_8**{: #utf_8 } | `"utf-8"` | UTF-8. | -| **utf_8_bom**{: #utf_8_bom } | `"utf-8 bom"` | UTF-8 with byte-order mark. | -| **utf_16**{: #utf_16 } | `"utf-16"` | UTF-16 (little-endian). | -| **utf_16_bom**{: #utf_16_bom } | `"utf-16 bom"` | UTF-16 with byte-order mark. | -| **us_ascii**{: #us_ascii } | `"us-ascii"` | 7-bit US-ASCII. | - -## KOI8 (Cyrillic) - -| Constant | Value | Description | -|----------|-------|-------------| -| **koi8_r**{: #koi8_r } | `"koi8_r"` | KOI8-R, Russian. | -| **koi8_u**{: #koi8_u } | `"koi8_u"` | KOI8-U, Ukrainian. | - -## Big5 - -| Constant | Value | Description | -|----------|-------|-------------| -| **big5**{: #big5 } | `"big5"` | Big5, Traditional Chinese. | - -## ISO 8859 - -| Constant | Value | Description | -|----------|-------|-------------| -| **iso_8859_1_latin1**{: #iso_8859_1_latin1 } | `"iso-8859-1"` | Latin-1, Western European. | -| **iso_8859_2_latin2**{: #iso_8859_2_latin2 } | `"iso-8859-2"` | Latin-2, Central European. | -| **iso_8859_3_latin3**{: #iso_8859_3_latin3 } | `"iso-8859-3"` | Latin-3, South European (Esperanto, Maltese). | -| **iso_8859_4_latin4**{: #iso_8859_4_latin4 } | `"iso-8859-4"` | Latin-4, North European. | -| **iso_8859_5_cyrillic**{: #iso_8859_5_cyrillic } | `"iso-8859-5"` | Cyrillic. | -| **iso_8859_6_arabic**{: #iso_8859_6_arabic } | `"iso-8859-6"` | Arabic. | -| **iso_8859_7_greek**{: #iso_8859_7_greek } | `"iso-8859-7"` | Greek. | -| **iso_8859_8_hebrew**{: #iso_8859_8_hebrew } | `"iso-8859-8"` | Hebrew. | -| **iso_8859_9_latin5_turkish**{: #iso_8859_9_latin5_turkish } | `"iso-8859-9"` | Latin-5, Turkish. | -| **iso_8859_10_latin6_nordic**{: #iso_8859_10_latin6_nordic } | `"iso-8859-10"` | Latin-6, Nordic. | -| **iso_8859_11_thai**{: #iso_8859_11_thai } | `"iso-8859-11"` | Thai. | -| **iso_8859_13_latin8_baltic**{: #iso_8859_13_latin8_baltic } | `"iso-8859-13"` | Latin-7, Baltic Rim. | -| **iso_8859_14_latin8_celtic**{: #iso_8859_14_latin8_celtic } | `"iso-8859-14"` | Latin-8, Celtic. | -| **iso_8859_15_latin9_euro**{: #iso_8859_15_latin9_euro } | `"iso-8859-15"` | Latin-9, Western European with euro sign. | -| **iso_8859_16_latin10_balkan**{: #iso_8859_16_latin10_balkan } | `"iso-8859-16"` | Latin-10, South-Eastern European. | - -## Windows code pages - -| Constant | Value | Description | -|----------|-------|-------------| -| **windows_1250_central_europe**{: #windows_1250_central_europe } | `"windows-1250"` | Central European. | -| **windows_1251_cyrillic**{: #windows_1251_cyrillic } | `"windows-1251"` | Cyrillic. | -| **windows_1252_western**{: #windows_1252_western } | `"windows-1252"` | Western European. | -| **windows_1253_greek**{: #windows_1253_greek } | `"windows-1253"` | Greek. | -| **windows_1254_turkish**{: #windows_1254_turkish } | `"windows-1254"` | Turkish. | -| **windows_1255_hebrew**{: #windows_1255_hebrew } | `"windows-1255"` | Hebrew. | -| **windows_1256_arabic**{: #windows_1256_arabic } | `"windows-1256"` | Arabic. | -| **windows_1257_baltic**{: #windows_1257_baltic } | `"windows-1257"` | Baltic. | -| **windows_1258_vietnamese**{: #windows_1258_vietnamese } | `"windows-1258"` | Vietnamese. | - -## IBM/OEM code pages - -| Constant | Value | Description | -|----------|-------|-------------| -| **ibm_850_western_europe**{: #ibm_850_western_europe } | `"850"` | OEM Multilingual Latin-1, Western European. | -| **ibm_852_central_and_eastern_europe**{: #ibm_852_central_and_eastern_europe } | `"852"` | OEM Latin-2, Central and Eastern European. | -| **ibm_855_cyrillic**{: #ibm_855_cyrillic } | `"855"` | OEM Cyrillic (primarily pre-Unicode Russian). | -| **ibm_856_hebrew**{: #ibm_856_hebrew } | `"856"` | Hebrew. | -| **ibm_857_turkish**{: #ibm_857_turkish } | `"857"` | OEM Turkish (Latin-5). | -| **ibm_858_western_europe**{: #ibm_858_western_europe } | `"858"` | OEM Multilingual Latin-1 with euro sign. | -| **ibm_860_portuguese**{: #ibm_860_portuguese } | `"860"` | Portuguese. | -| **ibm_861_icelandic**{: #ibm_861_icelandic } | `"861"` | Icelandic. | -| **ibm_862_hebrew**{: #ibm_862_hebrew } | `"862"` | Hebrew. | -| **ibm_863_canadian**{: #ibm_863_canadian } | `"863"` | French Canadian. | -| **ibm_865_danish**{: #ibm_865_danish } | `"865"` | Nordic (Danish, Norwegian). | -| **ibm_866_cyrillic**{: #ibm_866_cyrillic } | `"866"` | Russian. | -| **ibm_869_greek**{: #ibm_869_greek } | `"869"` | Modern Greek. | -| **ibm_932_japanese**{: #ibm_932_japanese } | `"932"` | Japanese (Shift-JIS, Microsoft variant). | -| **ibm_949_korean**{: #ibm_949_korean } | `"949"` | Korean (Unified Hangul Code). | - -## See Also - -- [File I/O encoding options](../../../Features/Standard-Library/File-IO) diff --git a/docs/Reference/VBA/index.md b/docs/Reference/VBA/index.md index aa9cdf39..3c463cf2 100644 --- a/docs/Reference/VBA/index.md +++ b/docs/Reference/VBA/index.md @@ -5,8 +5,33 @@ nav_order: 22 permalink: /tB/Packages/VBA redirect_from: - /tB/Modules +has_toc: false --- # VBA Package -These modules are in the VBA built-in package. +The VBA built-in package collects the standard runtime library — the modules grouping the standalone procedures (**MsgBox**, **CStr**, **Mid**, **Format**, …), plus a small number of intrinsic classes (**Collection**, **Err**) and twinBASIC's runtime expression engine. + +## Classes + +- [Collection](../Modules/Collection) -- ordered set of values or object references, accessed by 1-based index or by optional string key +- [ErrObject](../Modules/ErrObject) -- the singleton **Err** object holding information about the most recent run-time error +- [TbExpressionService](../Modules/ExpressionService) -- runtime expression engine — parse and evaluate twinBASIC-syntax expressions supplied as strings + +## Modules + +- [(Default)](../Modules/HiddenModule) -- unqualified low-level intrinsics — the **GetMem** / **PutMem** family, **AllocMem**, atomic operations, compile-time reflection, codegen and stack-inspection primitives, … +- [Compilation](../Modules/Compilation) -- compile-time intrinsics that record the project, component, procedure, and source file at the call site +- [Constants](../Modules/Constants) -- global character, pointer, and error-base constants reachable without qualification (**vbCrLf**, **vbNullString**, **vbObjectError**, …) +- [Conversion](../Modules/Conversion) -- type coercion (**CBool**, **CDate**, **CType**, …), number ↔ string parsing, base conversion, and **Variant**-with-error construction +- [DateTime](../Modules/DateTime) -- reading the system clock, building **Date** values from components, parsing them out of strings, and shifting them by chosen units +- [FileSystem](../Modules/FileSystem) -- pathname-based and file-number-based operations on files and directories +- [Financial](../Modules/Financial) -- annuity calculations, internal-rate-of-return analysis on variable cash flows, and asset depreciation +- [Information](../Modules/Information) -- **Is…** predicates, **VarType** / **TypeName**, array bounds and construction, raw pointers (**ObjPtr**, **StrPtr**, **VarPtr**), and **RGB** colour helpers +- [Interaction](../Modules/Interaction) -- dialogs (**MsgBox**, **InputBox**), inline conditionals (**Choose**, **Switch**, **IIf**), process launching, registry helpers, environment, and dynamic-dispatch primitives +- [Math](../Modules/Math) -- sign and magnitude, trigonometry, exponentials and logarithms, the square root, rounding, and pseudo-random numbers +- [Strings](../Modules/Strings) -- measuring, searching, slicing, padding, joining, splitting, and formatting **String** values + +> [!NOTE] +> +> The modules listed above are used for grouping documentation, they don't always match exactly with the implementation details of the VBA package. From 67c672ad2da5f7c312edb42682a5740971bb1e00 Mon Sep 17 00:00:00 2001 From: Kuba Sunderland-Ober Date: Wed, 13 May 2026 12:53:37 +0200 Subject: [PATCH 3/3] Improve the VBRUN package organization. --- .../VBRUN/AmbientProperties/index.md | 5 ++-- docs/Reference/VBRUN/AsyncProperty/index.md | 5 ++-- .../VBRUN/ContainedControls/index.md | 5 ++-- docs/Reference/VBRUN/DataMembers/index.md | 5 ++-- docs/Reference/VBRUN/DataObject/index.md | 5 ++-- docs/Reference/VBRUN/ErrorCallstack/index.md | 5 ++-- docs/Reference/VBRUN/ErrorContext/index.md | 5 ++-- docs/Reference/VBRUN/ErrorStackFrame/index.md | 5 ++-- docs/Reference/VBRUN/Hyperlink/index.md | 5 ++-- docs/Reference/VBRUN/ParentControls/index.md | 5 ++-- docs/Reference/VBRUN/PropertyBag/index.md | 5 ++-- docs/Reference/VBRUN/index.md | 23 +++++++++++++++++-- 12 files changed, 54 insertions(+), 24 deletions(-) diff --git a/docs/Reference/VBRUN/AmbientProperties/index.md b/docs/Reference/VBRUN/AmbientProperties/index.md index be3bba9a..0559e63f 100644 --- a/docs/Reference/VBRUN/AmbientProperties/index.md +++ b/docs/Reference/VBRUN/AmbientProperties/index.md @@ -1,13 +1,14 @@ --- -title: AmbientProperties Module +title: AmbientProperties parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/AmbientProperties/ redirect_from: - /tB/Modules/AmbientProperties has_toc: false --- -# AmbientProperties module +# AmbientProperties class The **AmbientProperties** object exposes information about the environment in which a control is hosted. The container — a form, a property page, the IDE designer surface — populates this object with hints about its appearance, locale, and operating mode so that an embedded control can adapt itself to fit in. Every property is read-only: the container, not the control, decides what these values should be. diff --git a/docs/Reference/VBRUN/AsyncProperty/index.md b/docs/Reference/VBRUN/AsyncProperty/index.md index 6015dae8..1777ec27 100644 --- a/docs/Reference/VBRUN/AsyncProperty/index.md +++ b/docs/Reference/VBRUN/AsyncProperty/index.md @@ -1,13 +1,14 @@ --- -title: AsyncProperty Module +title: AsyncProperty parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/AsyncProperty/ redirect_from: - /tB/Modules/AsyncProperty has_toc: false --- -# AsyncProperty module +# AsyncProperty class The **AsyncProperty** object carries the results of an asynchronous read started with **UserControl.AsyncRead**. It is passed to the **AsyncReadComplete** and **AsyncReadProgress** events, where it identifies which read this notification refers to, reports how far the download has got, and — once complete — supplies the downloaded value. Every property is read-only: the runtime fills the object in before raising the event. diff --git a/docs/Reference/VBRUN/ContainedControls/index.md b/docs/Reference/VBRUN/ContainedControls/index.md index 8226bb8c..f3f368a7 100644 --- a/docs/Reference/VBRUN/ContainedControls/index.md +++ b/docs/Reference/VBRUN/ContainedControls/index.md @@ -1,13 +1,14 @@ --- -title: ContainedControls Module +title: ContainedControls parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/ContainedControls/ redirect_from: - /tB/Modules/ContainedControls has_toc: false --- -# ContainedControls module +# ContainedControls class The **ContainedControls** object is a collection that exposes the controls placed inside an instance of a **UserControl** that has been set up as a control container. The author of the **UserControl** uses this collection to enumerate or inspect those constituent controls at run time. The author of the **UserControl** sees only what the consumer added — controls placed on the **UserControl** at design time by the author themselves are not part of this collection. diff --git a/docs/Reference/VBRUN/DataMembers/index.md b/docs/Reference/VBRUN/DataMembers/index.md index 40174b91..d9191560 100644 --- a/docs/Reference/VBRUN/DataMembers/index.md +++ b/docs/Reference/VBRUN/DataMembers/index.md @@ -1,13 +1,14 @@ --- -title: DataMembers Module +title: DataMembers parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/DataMembers/ redirect_from: - /tB/Modules/DataMembers has_toc: false --- -# DataMembers module +# DataMembers class The **DataMembers** object is a collection of names that a data source class advertises at design time, so that a consumer binding to the data source can choose which member to bind to. Each entry is a **String** — the name of a data member the source can supply on request. The data source manages the list directly with [**Add**](#add), [**Remove**](#remove), and [**Clear**](#clear); the design-time environment reads it back through [**Count**](#count), [**Item**](#item), and **For Each** iteration to populate the data member picker. diff --git a/docs/Reference/VBRUN/DataObject/index.md b/docs/Reference/VBRUN/DataObject/index.md index 9999d40b..eb128fb2 100644 --- a/docs/Reference/VBRUN/DataObject/index.md +++ b/docs/Reference/VBRUN/DataObject/index.md @@ -1,13 +1,14 @@ --- -title: DataObject Module +title: DataObject parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/DataObject/ redirect_from: - /tB/Modules/DataObject has_toc: false --- -# DataObject module +# DataObject class A **DataObject** is a container for one piece of information held in one or more clipboard formats — the same payload represented as plain text, Unicode text, RTF, a bitmap, a list of file paths, and so on. The runtime hands a **DataObject** to clipboard and OLE drag-and-drop operations: the source side fills it with [**SetData**](SetData), and the destination side inspects what's available with [**GetFormat**](GetFormat) (or [**AvailableFormats**](AvailableFormats)) and pulls the bytes out with [**GetData**](GetData). diff --git a/docs/Reference/VBRUN/ErrorCallstack/index.md b/docs/Reference/VBRUN/ErrorCallstack/index.md index ccee1dab..acb9ab5e 100644 --- a/docs/Reference/VBRUN/ErrorCallstack/index.md +++ b/docs/Reference/VBRUN/ErrorCallstack/index.md @@ -1,13 +1,14 @@ --- -title: ErrorCallstack Module +title: ErrorCallstack parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/ErrorCallstack/ redirect_from: - /tB/Modules/ErrorCallstack has_toc: false --- -# ErrorCallstack module +# ErrorCallstack class An **ErrorCallstack** object is a snapshot of the chain of procedures that were active on the call stack at the moment a run-time error was raised — outermost frame first, innermost (the procedure that actually raised the error) last. Each frame is exposed as an [**ErrorStackFrame**](../ErrorStackFrame), describing one procedure by its project, module, and procedure names. diff --git a/docs/Reference/VBRUN/ErrorContext/index.md b/docs/Reference/VBRUN/ErrorContext/index.md index 3336fa7a..29b6d13b 100644 --- a/docs/Reference/VBRUN/ErrorContext/index.md +++ b/docs/Reference/VBRUN/ErrorContext/index.md @@ -1,13 +1,14 @@ --- -title: ErrorContext Module +title: ErrorContext parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/ErrorContext/ redirect_from: - /tB/Modules/ErrorContext has_toc: false --- -# ErrorContext module +# ErrorContext class An **ErrorContext** object captures everything the runtime knows about a run-time error: its identity ([**Number**](#number), [**Description**](#description), [**Source**](#source)), its help references ([**HelpFile**](#helpfile), [**HelpContext**](#helpcontext)), the operating-system error code at the time it was raised ([**LastDLLError**](#lastdllerror)), the [**State**](#state) of the error-handling machinery, and a snapshot of the [**Callstack**](#callstack) from the moment of the failure. It is twinBASIC's structured counterpart to the simpler [**Err**](../../../Modules/ErrObject) object. diff --git a/docs/Reference/VBRUN/ErrorStackFrame/index.md b/docs/Reference/VBRUN/ErrorStackFrame/index.md index 90cbac4e..3b9df960 100644 --- a/docs/Reference/VBRUN/ErrorStackFrame/index.md +++ b/docs/Reference/VBRUN/ErrorStackFrame/index.md @@ -1,13 +1,14 @@ --- -title: ErrorStackFrame Module +title: ErrorStackFrame parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/ErrorStackFrame/ redirect_from: - /tB/Modules/ErrorStackFrame has_toc: false --- -# ErrorStackFrame module +# ErrorStackFrame class An **ErrorStackFrame** describes one procedure that was active on the call stack at the moment a run-time error was raised — the project it belongs to, the module that contains it, and its own name. Frames are produced by walking an [**ErrorCallstack**](../ErrorCallstack) snapshot, which in turn is reachable from the [**Callstack**](../ErrorContext#callstack) property of an [**ErrorContext**](../ErrorContext). Every property is read-only. diff --git a/docs/Reference/VBRUN/Hyperlink/index.md b/docs/Reference/VBRUN/Hyperlink/index.md index 35fd0f36..e808fac7 100644 --- a/docs/Reference/VBRUN/Hyperlink/index.md +++ b/docs/Reference/VBRUN/Hyperlink/index.md @@ -1,13 +1,14 @@ --- -title: Hyperlink Module +title: Hyperlink parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/Hyperlink/ redirect_from: - /tB/Modules/Hyperlink has_toc: false --- -# Hyperlink module +# Hyperlink class The **Hyperlink** object lets a control or form ask its container to navigate to a target document, the way clicking a link in a browser would. It is used from a control's code through the host's **Hyperlink** property — for example **UserControl.Hyperlink** — and works in containers that participate in browser-style navigation (Internet Explorer, Office binders, and a handful of other hyperlink-aware hosts). When the host does not support hyperlink navigation, the runtime falls back to launching the system's default handler for the target. diff --git a/docs/Reference/VBRUN/ParentControls/index.md b/docs/Reference/VBRUN/ParentControls/index.md index 9602b0a3..8714f295 100644 --- a/docs/Reference/VBRUN/ParentControls/index.md +++ b/docs/Reference/VBRUN/ParentControls/index.md @@ -1,13 +1,14 @@ --- -title: ParentControls Module +title: ParentControls parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/ParentControls/ redirect_from: - /tB/Modules/ParentControls has_toc: false --- -# ParentControls module +# ParentControls class The **ParentControls** object is the collection of other controls that live in the same container as a **UserControl** — its siblings on the host form, frame, or page. It is reachable inside a **UserControl** through **UserControl.ParentControls** and lets the control discover and interact with the other controls around it without being given explicit references. diff --git a/docs/Reference/VBRUN/PropertyBag/index.md b/docs/Reference/VBRUN/PropertyBag/index.md index 62a94023..311aff53 100644 --- a/docs/Reference/VBRUN/PropertyBag/index.md +++ b/docs/Reference/VBRUN/PropertyBag/index.md @@ -1,13 +1,14 @@ --- -title: PropertyBag Module +title: PropertyBag parent: VBRUN Package +nav_order: 10 permalink: /tB/Packages/VBRUN/PropertyBag/ redirect_from: - /tB/Modules/PropertyBag has_toc: false --- -# PropertyBag module +# PropertyBag class A **PropertyBag** is a small key/value store designed for persisting an object's state across sessions. Each entry is a name and a **Variant** value; reading and writing entries is symmetric, so the same code that loaded the bag's state at start-up can store it again at shutdown. The whole bag can also be retrieved or replaced as a single byte array through [**Contents**](#contents), which makes it straightforward to save the state to a file, a database column, or another **PropertyBag**. diff --git a/docs/Reference/VBRUN/index.md b/docs/Reference/VBRUN/index.md index 6b318450..3cae8030 100644 --- a/docs/Reference/VBRUN/index.md +++ b/docs/Reference/VBRUN/index.md @@ -2,9 +2,28 @@ title: VBRUN Package parent: Reference Section nav_order: 23 -permalink: /tB/Packages/VBRUN +permalink: /tB/Packages/VBRUN/ +has_toc: false --- # VBRUN Package -These modules are in the VBRUN built-in package. +The VBRUN built-in package collects twinBASIC's runtime-only types: the ambient, asynchronous, and error-handling objects the runtime hands to controls and event handlers; the collection wrappers it exposes on **UserControl** and on data-source classes; the clipboard / OLE drag-and-drop container; the **PropertyBag** persistence helper used by **UserControl** save and load; and the enumerations that classic VB6 forms, intrinsic controls, and runtime services use to spell out their option values. + +## Classes + +- [AmbientProperties](AmbientProperties) -- read-only object describing the host container's appearance, locale, and design / run-time mode for an embedded control +- [AsyncProperty](AsyncProperty) -- event-argument object that identifies an asynchronous **UserControl.AsyncRead** request and carries the resulting value +- [ContainedControls](ContainedControls) -- read-only collection of the controls a consumer placed inside a control-container **UserControl** +- [DataMembers](DataMembers) -- collection of named data-source members advertised at design time to data-binding consumers +- [DataObject](DataObject) -- clipboard / OLE drag-and-drop container that holds one payload in multiple clipboard formats +- [ErrorCallstack](ErrorCallstack) -- snapshot of the call stack at the moment a run-time error was raised, exposed as a sequence of [**ErrorStackFrame**](ErrorStackFrame) items +- [ErrorContext](ErrorContext) -- structured error object — number, description, source, help, OS error, state, and call stack +- [ErrorStackFrame](ErrorStackFrame) -- single procedure on an [**ErrorCallstack**](ErrorCallstack) — its project, module, and procedure names +- [Hyperlink](Hyperlink) -- runtime hand-off for browser-style navigation; controls call **UserControl.Hyperlink.NavigateTo** to ask the host to load a target +- [ParentControls](ParentControls) -- collection of the **UserControl**'s siblings in its container, optionally wrapped in their host **Extender** +- [PropertyBag](PropertyBag) -- creatable key / value store for persisting an object's state — used by **UserControl** save / load and serialisable as a single byte array + +## Modules + +- [Constants](Constants) -- enumerations used by classic VB6 forms, intrinsic controls, and runtime services — colours, mouse pointers, key codes, drag/drop states, OLE container behaviour, printer setup values, …