Skip to content

Run-time errors for the Strings module, page shortcuts, help add-in 1.1.0, and five defects queued - #248

Merged
KubaO merged 21 commits into
twinbasic:mainfrom
KubaO:staging
Oct 20, 2026
Merged

KubaO merged 21 commits into
twinbasic:mainfrom
KubaO:staging

Conversation

@KubaO

@KubaO KubaO commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Adds a Common Errors section to the Strings module's pages and a central Run-time Errors page, tb: page shortcuts and help add-in 1.1.0, and queues five twinBASIC defects found along the way.

  • Run-time errors: a Discord reader asked which errors a procedure can raise, which no VB or VBA reference lists. The errors are data (errors/*.yml: the cases that raise each error, and the cases that must raise nothing), measured in twinBASIC 32-bit and VB6 on BETA 1010. They are written into each page's Common Errors section as number (decimal and VB hexadecimal), Err.Description and condition.
    • Tooling: scripts/errors.mjs has run (builds a probe per runtime and compares every case with the data), write (writes the sections) and messages (measures errors/messages.yml in both runtimes). check_errors.mjs keeps sections and data in step; it is test.bat's 29th step and runs in CI.
    • Run-time Errors page (/Reference/Run-time-Errors, in the book, page baseline 1503): every number from 1 to 65535 with a message of its own (88; twinBASIC and VB6 agree on all) and the HRESULTs the data names. Each has an anchor and a generated list of the pages that raise it.
    • Pages: ReDim and 28 of the 30 Strings pages, 339 cases, all agreeing in twinBASIC and VB6. Any error a Null argument raises is listed. A case where only VB6 raises (error: 0) is a NOTE only. Join and Filter of a Long or Double array are documented as an extension. VBA text that twinBASIC and VB6 both contradict, such as the vbUseCompareOption rows, is kept as <!-- VBA: --> comments.
    • WIP.Errors.md: the decisions, the design and how a batch runs. Next is batch 3, Conversion.
  • Page shortcuts: shortcut: <Name> in a page's front matter lets any page link to it as [5](tb:Errors#5), from any folder and with no ../. The build writes the real URL. An unknown name, a name two pages claim and a tb: image source fail the build, and inside code the link is left as written. Errors is the first, and its anchors are the bare error numbers. Documented on the Authoring page.
  • Help add-in 1.1.0: other add-ins' Ctrl and Alt shortcuts fire while it is loaded (the IDE alone does not run them), the help window follows the IDE's font size, and Ctrl+F finds text in the shortcut and panel-layout editors. The settings panel gets a box for each page-side fix. It now has a version and add-in/CHANGELOG.md; the Help_Settings pictures are retaken.
  • Tools: every IDE the tools start runs with default settings, because launchIde answers GetIDESetting with "no saved value" in the page (tb-defaults.mjs). try-help-addin keeps the user's.
  • Defects queued (5, BETA 1010): each has a reproducer under bugs/ with a VB6 side.
    • ReDim with an upper bound below the lower raises -2147467259, Unspecified error; VB6 raises 9.
    • A compare of vbDatabaseCompare raises no error in InStr, StrComp and Filter; VB6 raises 5.
    • InStr raises 5 for an invalid LCID when string1 or string2 is zero-length; VB6 raises nothing.
    • String with a character of Null raises 94; VB6 returns Null.
    • StrConv with vbWide, vbNarrow, vbKatakana or vbHiragana and an East Asian LCID raises 5 on a system whose locale is not East Asian; VB6 converts.

KubaO added 21 commits October 21, 2026 00:43
… page (tb-defaults.mjs); try-help-addin keeps the user's
…olls to each match), and a setting for each page-side fix
…e raises

A reader on Discord asked for what no VB or VBA reference gives: the errors a
function, statement or operator can raise. The owner's decisions: data-driven
error tables, measured in twinBASIC 32-bit and VB6 (64-bit too for operators
and Math), scoped to Default, Core and Built-In, with the error prose already
on pages moved into the tables. The file sets out what a page gets, the
central error page, what the tooling (batch 0) must settle, what a session
starting it must know and when it is done, and sixteen batches with their
status. WIP.md's table points to it.
…d its gate

errors/*.yml lists, per page, the cases that raise each error and the cases
that must raise nothing. scripts/errors.mjs run builds one probe per runtime
(twinBASIC exe via tbrun --exe, win64 on request, VB6 via runRepro), drops and
rebuilds around a case a compiler refuses, and compares every case with the
data; write writes each page's Errors section between markers.
check_errors.mjs, the new test.bat and CI gate, keeps sections and data in step.

Trial: Mid (three rows, measured limits of start and length), ReDim (VB6
differs on an upper bound below the lower: NOTE, bug pending), Len (raises
nothing, no section). All 37 cases agree in twinBASIC BETA 1010 and VB6.
-2147467259 (`&H80004005`), 5 (`&H5`): in the table and in the VB6 NOTE.
WIP.Errors.md records the owner's answers on the trial's open points.
…the sections linked to it

docs/Reference/Run-time-Errors.md lists every number from 1 to 65535 with a
message of its own (88, measured: twinBASIC 32-bit and VB6 agree on all of
them) and the HRESULTs the data names, each with its anchor, its message and
the pages whose Errors sections list it. errors.mjs write generates the index
between markers; check_errors.mjs verifies it. Each number in a section now
links to its anchor, and rows of a page that raise the same number share one
table row, their conditions joined with <br>.

errors/messages.yml takes { raised, error } where Err.Description and
Error$(n) differ; the new errors.mjs messages command measures the file in
both runtimes.
The heading write makes, the central page's references to the sections,
the gate's probes, the tools' docs and WIP.Errors.md.
…p, Filter), and an invalid LCID refused on a zero-length string; ReDim entry moved below the header
…ull; StrConv's East Asian conversions refuse an East Asian LCID on a Western system
@KubaO
KubaO merged commit 2846a37 into twinbasic:main Oct 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant