Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
55487af
Errors batch 7: files harness, data and Common Errors sections for th…
KubaO Oct 27, 2026
aab8f47
Errors batch 7: file-errors-unspecified extended; kill-hidden-system-…
KubaO Oct 27, 2026
ec7e339
Errors batch 7 done: findings in WIP.Errors.md
KubaO Oct 27, 2026
49685e0
Errors batch 8: data and Common Errors sections for the Collection an…
KubaO Oct 27, 2026
fa4e0ea
Errors batch 8: collection-index-checks, err-raise-hresult-mapping, e…
KubaO Oct 27, 2026
275cf37
Errors batch 8 done but for three questions: findings in WIP.Errors.md
KubaO Oct 27, 2026
eb9238a
Errors batch 8 done: owner's rulings applied (two extensions, Empty k…
KubaO Oct 28, 2026
c62ce75
Errors batch 9 done but for the owner's rulings: VBA Financial, findi…
KubaO Oct 28, 2026
a2053a1
Errors batch 9 done: owner's rulings applied (five entries queued, on…
KubaO Oct 28, 2026
e73966a
Errors batch 10 done but for the owner's rulings: VBA HiddenModule, C…
KubaO Oct 28, 2026
1276b32
Errors batch 10: owner's rulings 1 to 3 applied (three entries queued…
KubaO Oct 28, 2026
4c2e8d4
Errors batch 10 done: vbaCastObj's missing 13 queued, CreateGUID and …
KubaO Oct 28, 2026
980458a
expression-service-error-numbers asks only for errors to pass through…
KubaO Oct 28, 2026
65c3c81
Errors batch 10: the expression service's other differences stay NOTE…
KubaO Oct 28, 2026
dbf2e7b
impexp: refuse an argument holding a double quote (a quoted folder en…
KubaO Oct 28, 2026
4a407d2
Literal Keywords page: Nothing, Null, Empty, True and False, a sectio…
KubaO Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,659 changes: 2,649 additions & 10 deletions BUGS-TO-REPORT.md

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion WIP.Authoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ both. A page whose title cannot name its subject says so with `symbols:`, which
those names. Two pages need it: the (Default) module (`[_HiddenModule]`) and the comparison
operators (`["=", "<>", "<", "<=", ">", ">="]`, quoted, since a bare `>` is YAML). On a
Core statement page the first name is the statement and the rest its keywords; on an
operator page each is an operator.
operator page each is an operator. **Quote `True`, `False` and `Null` too**: YAML reads them
bare as a boolean and as null, and `symbolPages` fails the build on any entry that is not a
string, rather than index it as `true`.

Two summary pages outside `/tB/` are read as well (`SUMMARY_PAGES` in
[builder/symbols.mjs](builder/symbols.mjs)): each name of their `symbols:` is at the `##`
heading of that name, a `type` on `Reference/Data-Types.md` and a `keyword` on
`Reference/Literal-Keywords.md` (owner, 2026-10-29: one page for **Nothing**, **Null**,
**Empty**, **True** and **False**, a section each). `keyword` rather than `constant`, because
the search ranks a keyword with no package first and a constant not; it is also VBA's word
for them. A name with no such heading fails the build.

The build names any page in a package folder that gives the index no entry, after its
summary line. That is the cue for a third. **Do not add `symbols:` to change how a page
Expand Down
2 changes: 1 addition & 1 deletion WIP.Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ opens in the IDE and builds (`bundle_extra`, `docs/_config.yml`). It is laid out
for byte; nothing checks that they agree, so a change to `src/` is packed again by hand
(`node scripts/impexp.mjs import scripts/impexp/impexp.twinproj scripts/impexp/src
--overwrite`). It has the same command line, output, exit codes and `--self-test` (the same
20 tests) as `impexp.mjs` and `impexp.py`, and writes byte-identical project files. Its tests
21 tests) as `impexp.mjs` and `impexp.py`, and writes byte-identical project files. Its tests
are that `--self-test` and the commands of `check_impexp_parity.mjs`, which compares it
when `IMPEXP_EXE` names its built exe, because no gate can build it; CI never sets the
variable. The check runs the exe through `launchOnDesktop` with `cwd` (`TBBUILD_CWD` in
Expand Down
337 changes: 318 additions & 19 deletions WIP.Errors.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions add-in/Resources/SYMBOLS/symbols.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
{"name":"Single","package":null,"container":null,"kind":"type","url":"/Reference/Data-Types#single"},
{"name":"String","package":null,"container":null,"kind":"type","url":"/Reference/Data-Types#string"},
{"name":"Variant","package":null,"container":null,"kind":"type","url":"/Reference/Data-Types#variant"},
{"name":"Empty","package":null,"container":null,"kind":"keyword","url":"/Reference/Literal-Keywords#empty"},
{"name":"False","package":null,"container":null,"kind":"keyword","url":"/Reference/Literal-Keywords#false"},
{"name":"Nothing","package":null,"container":null,"kind":"keyword","url":"/Reference/Literal-Keywords#nothing"},
{"name":"Null","package":null,"container":null,"kind":"keyword","url":"/Reference/Literal-Keywords#null"},
{"name":"True","package":null,"container":null,"kind":"keyword","url":"/Reference/Literal-Keywords#true"},
{"name":"AddressOf","package":null,"container":null,"kind":"operator","url":"/tB/Core/AddressOf"},
{"name":"Alias","package":null,"container":null,"kind":"statement","url":"/tB/Core/Alias"},
{"name":"And","package":null,"container":null,"kind":"operator","url":"/tB/Core/And"},
Expand Down
Binary file not shown.
12 changes: 11 additions & 1 deletion bugs/argument-errors-unspecified-error/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@
"^FAIL RegressionTests.MsgBox_HelpFileWithoutContext_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.InputBox_HelpFileWithoutContext_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.SendKeys_UnknownKeyCode_Raises5: .*Actual: -2147352567 ",
"^FAIL RegressionTests.SendKeys_WaitNull_Raises94: .*Actual: -2147352567 "
"^FAIL RegressionTests.SendKeys_WaitNull_Raises94: .*Actual: -2147352567 ",
"^FAIL RegressionTests.DDB_LifeZero_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.SLN_LifeZero_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.SYD_PeriodAboveLife_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.IPmt_NperZero_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.PPmt_NperNegative_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.Pmt_RateAndNperZero_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.NPer_RateAndPmtZero_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.Rate_NperZero_Raises5: .*Actual: -2147467259 ",
"^FAIL RegressionTests.Rate_NperBelowOneOverflow_Raises6: .*Actual: -2147467259 ",
"^FAIL RegressionTests.IRR_NoReceipt_Raises5: .*Actual: -2147467259 "
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -236,4 +236,86 @@ Module RegressionTests
Assert.Strict.AreEqual 94&, Err.Number
End Sub

' The Financial functions (batch 9).
[TestCase]
Public Sub DDB_LifeZero_Raises5()
Dim R As Double
On Error Resume Next
R = DDB(1000, 100, 0, 1)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub SLN_LifeZero_Raises5()
Dim R As Double
On Error Resume Next
R = SLN(1000, 100, 0)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub SYD_PeriodAboveLife_Raises5()
Dim R As Double
On Error Resume Next
R = SYD(1000, 100, 5, 6)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub IPmt_NperZero_Raises5()
Dim R As Double
On Error Resume Next
R = IPmt(0.01, 1, 0, 1000)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub PPmt_NperNegative_Raises5()
Dim R As Double
On Error Resume Next
R = PPmt(0.01, 1, -10, 1000)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub Pmt_RateAndNperZero_Raises5()
Dim R As Double
On Error Resume Next
R = Pmt(0, 0, 1000)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub NPer_RateAndPmtZero_Raises5()
Dim R As Double
On Error Resume Next
R = NPer(0, 0, 1000)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub Rate_NperZero_Raises5()
Dim R As Double
On Error Resume Next
R = Rate(0, -100, 1000)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

[TestCase]
Public Sub Rate_NperBelowOneOverflow_Raises6()
Dim R As Double
On Error Resume Next
R = Rate(0.5, -100, 1000)
Assert.Strict.AreEqual 6&, Err.Number
End Sub

[TestCase]
Public Sub IRR_NoReceipt_Raises5()
Dim R As Double, F(1) As Double
F(0) = -100: F(1) = -110
On Error Resume Next
R = IRR(F)
Assert.Strict.AreEqual 5&, Err.Number
End Sub

End Module
12 changes: 12 additions & 0 deletions bugs/argument-errors-unspecified-error/vb6/Module1.bas
Original file line number Diff line number Diff line change
Expand Up @@ -379,5 +379,17 @@ Sub Main()
dialog_End
SendKeys "{BAD}": Report "SendKeys_UnknownKeyCode"
SendKeys "", Null: Report "SendKeys_WaitNull"
Dim R As Double, F(1) As Double
R = DDB(1000, 100, 0, 1): Report "DDB_LifeZero"
R = SLN(1000, 100, 0): Report "SLN_LifeZero"
R = SYD(1000, 100, 5, 6): Report "SYD_PeriodAboveLife"
R = IPmt(0.01, 1, 0, 1000): Report "IPmt_NperZero"
R = PPmt(0.01, 1, -10, 1000): Report "PPmt_NperNegative"
R = Pmt(0, 0, 1000): Report "Pmt_RateAndNperZero"
R = NPer(0, 0, 1000): Report "NPer_RateAndPmtZero"
R = Rate(0, -100, 1000): Report "Rate_NperZero"
R = Rate(0.5, -100, 1000): Report "Rate_NperBelowOneOverflow"
F(0) = -100: F(1) = -110
R = IRR(F): Report "IRR_NoReceipt"
Close #9
End Sub
Binary file not shown.
25 changes: 25 additions & 0 deletions bugs/collection-index-checks/repro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"mode": "test",
"expect": {
"exit": 7,
"output": [
"^PASS RegressionTests\\.Control_ItemOfLongDoubleByte$",
"^PASS RegressionTests\\.Control_ItemOutOfRange_Raises9$",
"^PASS RegressionTests\\.Control_ItemOfMissingKey_Raises5$",
"^FAIL RegressionTests\\.Item_Currency_ReturnsItem: .*Actual: 9 ",
"^FAIL RegressionTests\\.Item_Decimal_ReturnsItem: .*Actual: 9 ",
"^FAIL RegressionTests\\.Item_Date_ReturnsItem: .*Actual: 9 ",
"^FAIL RegressionTests\\.Remove_Currency_Removes: .*Actual: 9 ",
"^FAIL RegressionTests\\.AddBefore_Currency_Adds: .*Actual: 13 ",
"^FAIL RegressionTests\\.Item_EmptyCollection_Raises5: .*Actual: 9 ",
"^FAIL RegressionTests\\.Item_Null_Raises13: .*Actual: 9 ",
"^FAIL RegressionTests\\.Item_Object_Raises13: .*Actual: 9 ",
"^FAIL RegressionTests\\.Item_BeyondLong_Raises13: .*Actual: 9 ",
"^FAIL RegressionTests\\.Remove_Null_Raises13: .*Actual: 9 ",
"^FAIL RegressionTests\\.AddBefore_MinusOne_Raises9: .*Actual: 13 ",
"^FAIL RegressionTests\\.AddBefore_Empty_Raises9: .*Actual: 13 ",
"^FAIL RegressionTests\\.AddBefore_BeyondLong_Raises13: .*Actual: 9 ",
"^FAIL RegressionTests\\.Add_EmptyKey_Raises13: .*Actual: 0 "
]
}
}
75 changes: 75 additions & 0 deletions bugs/collection-index-checks/src/Settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"configuration.inherits": "Defaults",
"project.appTitle": "CollectionIndexChecks",
"project.buildPath": "${SourcePath}\\Build\\${ProjectName}_${Architecture}.${FileExtension}",
"project.buildType": "Standard EXE",
"project.description": "Reproduces: Collection's Item, Remove and Add check an index or a position differently from VB",
"project.exportPathIsV2": true,
"project.id": "{4A7DA874-1C47-458C-A7CB-31B020EF778B}",
"project.name": "CollectionIndexChecks",
"project.optionExplicit": true,
"project.references": [
{
"id": "{00020430-0000-0000-C000-000000000046}",
"lcid": 0,
"name": "OLE Automation",
"path32": "C:\\Windows\\SysWOW64\\stdole2.tlb",
"path64": "C:\\Windows\\System32\\stdole2.tlb",
"symbolId": "stdole",
"versionMajor": 2,
"versionMinor": 0
},
{
"id": "{F50B82D0-DCAB-43FE-9631-11959D4A4728}",
"isCompilerPackage": true,
"licence": "MIT",
"name": "[COMPILER PACKAGE] twinBASIC - VB Compatibility Package (Forms)",
"path32": "",
"path64": "",
"publisher": "TWINBASIC-COMPILER",
"symbolId": "VB",
"versionBuild": 0,
"versionMajor": 0,
"versionMinor": 0,
"versionRevision": 31
},
{
"id": "{C192FB39-64CA-4D9B-B477-A5502F48EFCC}",
"isCompilerPackage": true,
"licence": "MIT",
"name": "[COMPILER PACKAGE] twinBASIC - App global class object",
"path32": "",
"path64": "",
"publisher": "TWINBASIC-COMPILER",
"symbolId": "AppGlobalClassProject",
"versionBuild": 0,
"versionMajor": 1,
"versionMinor": 0,
"versionRevision": 0
},
{
"id": "{9847A10D-8987-44B2-8B87-EA77DEF7F1D9}",
"isCompilerPackage": true,
"licence": "MIT",
"name": "[COMPILER PACKAGE] Assert",
"path32": "",
"path64": "",
"publisher": "TWINBASIC-COMPILER",
"symbolId": "Assert",
"versionBuild": 0,
"versionMajor": 0,
"versionMinor": 0,
"versionRevision": 24
}
],
"project.settingsVersion": 1,
"project.startupObject": "Sub Main",
"project.warnings": {
"errors": [],
"hints": [],
"ignored": [],
"info": [],
"warnings": []
},
"runtime.useUnicodeStandardLibrary": true
}
128 changes: 128 additions & 0 deletions bugs/collection-index-checks/src/Sources/RegressionTests.twin
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
' Regression tests: Collection's Item, Remove and Add take an index or a position as VB6 and
' 64-bit VBA do: a Currency, Decimal or Date number like any other number; 5 for a number on
' an empty collection (Item); 13 for Null, an object or a number outside the Long range
' (Item, Remove); 9 for a position of -1, True or Empty, and 13 for a key of Empty (Add). The controls use a Long, a
' Double and a Byte, and a string key. tbrun --tests runs each case and prints PASS or FAIL.
[TestFixture]
Module RegressionTests

' A collection holding "a" and "b", without keys.
Private Function Two() As Collection
Set Two = New Collection
Two.Add "a"
Two.Add "b"
End Function

' The error Item(Index) raises on C, or 0 and the item in Got.
Private Function ItemError(ByVal C As Collection, ByVal Index As Variant, Optional ByRef Got As Variant) As Long
On Error Resume Next
Got = C.Item(Index)
ItemError = Err.Number
End Function

Private Function RemoveError(ByVal C As Collection, ByVal Index As Variant) As Long
On Error Resume Next
C.Remove Index
RemoveError = Err.Number
End Function

Private Function AddBeforeError(ByVal C As Collection, ByVal Before As Variant) As Long
On Error Resume Next
C.Add "x", , Before
AddBeforeError = Err.Number
End Function

[TestCase]
Public Sub Control_ItemOfLongDoubleByte()
Dim Got As Variant
Assert.Strict.AreEqual 0&, ItemError(Two(), 2&, Got)
Assert.Strict.AreEqual "b", Got
Assert.Strict.AreEqual 0&, ItemError(Two(), 2#, Got)
Assert.Strict.AreEqual 0&, ItemError(Two(), CByte(2), Got)
End Sub

[TestCase]
Public Sub Control_ItemOutOfRange_Raises9()
Assert.Strict.AreEqual 9&, ItemError(Two(), 3)
End Sub

[TestCase]
Public Sub Control_ItemOfMissingKey_Raises5()
Assert.Strict.AreEqual 5&, ItemError(Two(), "z")
End Sub

[TestCase]
Public Sub Item_Currency_ReturnsItem()
Dim Got As Variant
Assert.Strict.AreEqual 0&, ItemError(Two(), CCur(2), Got)
End Sub

[TestCase]
Public Sub Item_Decimal_ReturnsItem()
Assert.Strict.AreEqual 0&, ItemError(Two(), CDec(2))
End Sub

[TestCase]
Public Sub Item_Date_ReturnsItem()
Assert.Strict.AreEqual 0&, ItemError(Two(), CDate(2))
End Sub

[TestCase]
Public Sub Remove_Currency_Removes()
Assert.Strict.AreEqual 0&, RemoveError(Two(), CCur(2))
End Sub

[TestCase]
Public Sub AddBefore_Currency_Adds()
Assert.Strict.AreEqual 0&, AddBeforeError(Two(), CCur(2))
End Sub

[TestCase]
Public Sub Item_EmptyCollection_Raises5()
Assert.Strict.AreEqual 5&, ItemError(New Collection, 1)
End Sub

[TestCase]
Public Sub Item_Null_Raises13()
Assert.Strict.AreEqual 13&, ItemError(Two(), Null)
End Sub

[TestCase]
Public Sub Item_Object_Raises13()
Assert.Strict.AreEqual 13&, ItemError(Two(), New Collection)
End Sub

[TestCase]
Public Sub Item_BeyondLong_Raises13()
Assert.Strict.AreEqual 13&, ItemError(Two(), 2147483648#)
End Sub

[TestCase]
Public Sub Remove_Null_Raises13()
Assert.Strict.AreEqual 13&, RemoveError(Two(), Null)
End Sub

[TestCase]
Public Sub AddBefore_MinusOne_Raises9()
Assert.Strict.AreEqual 9&, AddBeforeError(Two(), -1)
End Sub

[TestCase]
Public Sub AddBefore_Empty_Raises9()
Assert.Strict.AreEqual 9&, AddBeforeError(Two(), Empty)
End Sub

[TestCase]
Public Sub AddBefore_BeyondLong_Raises13()
Assert.Strict.AreEqual 13&, AddBeforeError(Two(), 2147483648#)
End Sub

[TestCase]
Public Sub Add_EmptyKey_Raises13()
Dim C As New Collection
On Error Resume Next
C.Add "x", Empty
Assert.Strict.AreEqual 13&, Err.Number
End Sub

End Module
Loading
Loading